1(function () { 2 "use strict"; 3 4 var languageCodes = { 5 deutsch: "DE", 6 english: "EN", 7 français: "FR", 8 french: "FR", 9 german: "DE", 10 }; 11 12 var getLanguageCode = function (label) { 13 var normalizedLabel = (label || "").trim().toLowerCase(); 14 var pathLanguage = window.location.pathname.split("/")[1].toLowerCase(); 15 16 if (pathLanguage === "de") { 17 return "DE"; 18 } 19 20 if (pathLanguage === "fr") { 21 return "FR"; 22 } 23 24 if (languageCodes[normalizedLabel]) { 25 return languageCodes[normalizedLabel]; 26 } 27 28 return "EN"; 29 }; 30 31 var updateLanguageCodes = function () { 32 document 33 .querySelectorAll( 34 ".lm-language-switcher .trp-shortcode-overlay .trp-language-item__current", 35 ) 36 .forEach(function (currentLanguage) { 37 var label = currentLanguage.querySelector(".trp-language-item-name"); 38 var code = getLanguageCode(label ? label.textContent : ""); 39 40 currentLanguage.style.setProperty( 41 "--unicorn-language-code", 42 '"' + code + '"', 43 ); 44 }); 45 }; 46 47 var initialize = function () { 48 updateLanguageCodes(); 49 50 var observer = new MutationObserver(updateLanguageCodes); 51 observer.observe(document.body, { childList: true, subtree: true }); 52 }; 53 54 if (document.readyState === "loading") { 55 document.addEventListener("DOMContentLoaded", initialize, { once: true }); 56 } else { 57 initialize(); 58 } 59})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.