1/** 2 * @file 3 * Set the "rh_locale" cookie to pass to access.redhat.com so users stay on the same language when going from redhat.com to access.redhat.com. 4 */ 5 6(function () { 7 "use strict"; 8 9 // Get lang code from html element. 10 let lang_code = document.querySelector('html').attributes.lang.value; 11 12 // Set default value to "en". 13 let lang_code_string = "en"; 14 15 // Access.redhat.com lang codes. 16 // en: "English", 17 // es: "Español", 18 // de: "Deutsch", 19 // it: "Italiano", 20 // ko: "íêµì´", 21 // fr: "Français", 22 // ja: "æ¥æ¬èª", 23 // pt: "Português", 24 // zh_CN: "䏿 (ä¸å½)", 25 // ru: "Ð ÑÑÑкий", 26 27 // Change lang code string value from what redhat.com uses to what access.redhat.com uses. 28 if (lang_code == "pt-br") { 29 lang_code_string = "pt"; 30 } else if (lang_code == "zh-cn") { 31 lang_code_string = "zh_CN"; 32 } else { 33 lang_code_string = lang_code; 34 } 35 36 // Set cookie to be picked up by access.redhat.com if the user changes domain. 37 document.cookie = "rh_locale=" + lang_code_string + ";" + "domain=.redhat.com"; 38})();
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.