Loading browser/components/preferences/config/languages.mjs +15 −1 Changes for browser/components/preferences/config/languages.mjs: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ export const Multilingual = { /** @type {LocaleCode[]} */ (await LangPackMatcher.getAvailableLocales()), code => code, (code, label) => ({ code, label }) ); ).sort((a, b) => (a.code > b.code ? 1 : -1)); }, /** Loading Loading @@ -209,6 +209,20 @@ Preferences.addSetting({ * @returns {SettingOptionConfig} */ function makeBrowserLanguageOption({ code, label }) { if (code === "ja-JP-macos") { // Mozilla codebases handle Japanese in macOS in different ways, sometimes // they call it ja-JP-mac and sometimes they call it ja-JP-macos. // The former is translated to Japanese when specifying preferNative to // true, the latter is not. Since seeing ja-JP-macos would be confusing // anyway, we treat it as a special case. // See tor-browser#41372 and Bug 1726586. label = Services.intl.getLocaleDisplayNames(undefined, ["ja"], { preferNative: true, })[0] + " (ja)"; } else { label += ` (${code})`; } return { value: code, controlAttrs: { Loading browser/components/preferences/main.js +2 −24 Changes for browser/components/preferences/main.js: 2 added lines, 24 removed lines. Original line number Diff line number Diff line Loading @@ -1402,30 +1402,8 @@ var gMainPane = { available, { preferNative: true } ); let locales = available.map((code, i) => { let name = localeNames[i].replace(/\s*\(.+\)$/g, ""); if (code === "ja-JP-macos") { // Mozilla codebases handle Japanese in macOS in different ways, // sometimes they call it ja-JP-mac and sometimes they call it // ja-JP-macos. The former is translated to Japanese when specifying // preferNative to true, the latter is not. Since seeing ja-JP-macos // would be confusing anyway, we treat it as a special case. // See tor-browser#41372 and Bug 1726586. name = Services.intl.getLocaleDisplayNames(undefined, ["ja"], { preferNative: true, })[0] + " (ja)"; } else { name += ` (${code})`; } return { code, name, }; }); // tor-browser#42335: Sort language codes independently from the locale, // so do not use localeCompare. locales.sort((a, b) => a.code > b.code); let locales = available.map((code, i) => ({ code, name: localeNames[i] })); locales.sort((a, b) => a.name > b.name); let fragment = document.createDocumentFragment(); for (let { code, name } of locales) { Loading Loading
browser/components/preferences/config/languages.mjs +15 −1 Changes for browser/components/preferences/config/languages.mjs: 15 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -56,7 +56,7 @@ export const Multilingual = { /** @type {LocaleCode[]} */ (await LangPackMatcher.getAvailableLocales()), code => code, (code, label) => ({ code, label }) ); ).sort((a, b) => (a.code > b.code ? 1 : -1)); }, /** Loading Loading @@ -209,6 +209,20 @@ Preferences.addSetting({ * @returns {SettingOptionConfig} */ function makeBrowserLanguageOption({ code, label }) { if (code === "ja-JP-macos") { // Mozilla codebases handle Japanese in macOS in different ways, sometimes // they call it ja-JP-mac and sometimes they call it ja-JP-macos. // The former is translated to Japanese when specifying preferNative to // true, the latter is not. Since seeing ja-JP-macos would be confusing // anyway, we treat it as a special case. // See tor-browser#41372 and Bug 1726586. label = Services.intl.getLocaleDisplayNames(undefined, ["ja"], { preferNative: true, })[0] + " (ja)"; } else { label += ` (${code})`; } return { value: code, controlAttrs: { Loading
browser/components/preferences/main.js +2 −24 Changes for browser/components/preferences/main.js: 2 added lines, 24 removed lines. Original line number Diff line number Diff line Loading @@ -1402,30 +1402,8 @@ var gMainPane = { available, { preferNative: true } ); let locales = available.map((code, i) => { let name = localeNames[i].replace(/\s*\(.+\)$/g, ""); if (code === "ja-JP-macos") { // Mozilla codebases handle Japanese in macOS in different ways, // sometimes they call it ja-JP-mac and sometimes they call it // ja-JP-macos. The former is translated to Japanese when specifying // preferNative to true, the latter is not. Since seeing ja-JP-macos // would be confusing anyway, we treat it as a special case. // See tor-browser#41372 and Bug 1726586. name = Services.intl.getLocaleDisplayNames(undefined, ["ja"], { preferNative: true, })[0] + " (ja)"; } else { name += ` (${code})`; } return { code, name, }; }); // tor-browser#42335: Sort language codes independently from the locale, // so do not use localeCompare. locales.sort((a, b) => a.code > b.code); let locales = available.map((code, i) => ({ code, name: localeNames[i] })); locales.sort((a, b) => a.name > b.name); let fragment = document.createDocumentFragment(); for (let { code, name } of locales) { Loading