Pier Angelo Vendrame pushed to branch mullvad-browser-153.4.0esr-16.0-1 at The Tor Project / Applications / Mullvad Browser Commits: a53ac65c by Pier Angelo Vendrame at 2026-09-28T14:18:52+02:00 fixup! BB 41369: Improve Firefox language settings for multi-lingual packages BB 45360: Move our language setting customization to the new design. - - - - - 2 changed files: - browser/components/preferences/config/languages.mjs - browser/components/preferences/main.js Changes: ===================================== browser/components/preferences/config/languages.mjs ===================================== @@ -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)); }, /** @@ -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: { ===================================== browser/components/preferences/main.js ===================================== @@ -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) { View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a53a... -- View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/commit/a53a... You're receiving this email because of your account on gitlab.torproject.org. Manage all notifications: https://gitlab.torproject.org/-/profile/notifications | Help: https://gitlab.torproject.org/help
participants (1)
-
Pier Angelo Vendrame (@pierov)