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
2 changed files:
Changes:
| ... | ... | @@ -56,7 +56,7 @@ export const Multilingual = { |
| 56 | 56 | /** @type {LocaleCode[]} */ (await LangPackMatcher.getAvailableLocales()),
|
| 57 | 57 | code => code,
|
| 58 | 58 | (code, label) => ({ code, label })
|
| 59 | - );
|
|
| 59 | + ).sort((a, b) => (a.code > b.code ? 1 : -1));
|
|
| 60 | 60 | },
|
| 61 | 61 | |
| 62 | 62 | /**
|
| ... | ... | @@ -209,6 +209,20 @@ Preferences.addSetting({ |
| 209 | 209 | * @returns {SettingOptionConfig}
|
| 210 | 210 | */
|
| 211 | 211 | function makeBrowserLanguageOption({ code, label }) {
|
| 212 | + if (code === "ja-JP-macos") {
|
|
| 213 | + // Mozilla codebases handle Japanese in macOS in different ways, sometimes
|
|
| 214 | + // they call it ja-JP-mac and sometimes they call it ja-JP-macos.
|
|
| 215 | + // The former is translated to Japanese when specifying preferNative to
|
|
| 216 | + // true, the latter is not. Since seeing ja-JP-macos would be confusing
|
|
| 217 | + // anyway, we treat it as a special case.
|
|
| 218 | + // See tor-browser#41372 and Bug 1726586.
|
|
| 219 | + label =
|
|
| 220 | + Services.intl.getLocaleDisplayNames(undefined, ["ja"], {
|
|
| 221 | + preferNative: true,
|
|
| 222 | + })[0] + " (ja)";
|
|
| 223 | + } else {
|
|
| 224 | + label += ` (${code})`;
|
|
| 225 | + }
|
|
| 212 | 226 | return {
|
| 213 | 227 | value: code,
|
| 214 | 228 | controlAttrs: {
|
| ... | ... | @@ -1402,30 +1402,8 @@ var gMainPane = { |
| 1402 | 1402 | available,
|
| 1403 | 1403 | { preferNative: true }
|
| 1404 | 1404 | );
|
| 1405 | - let locales = available.map((code, i) => {
|
|
| 1406 | - let name = localeNames[i].replace(/\s*\(.+\)$/g, "");
|
|
| 1407 | - if (code === "ja-JP-macos") {
|
|
| 1408 | - // Mozilla codebases handle Japanese in macOS in different ways,
|
|
| 1409 | - // sometimes they call it ja-JP-mac and sometimes they call it
|
|
| 1410 | - // ja-JP-macos. The former is translated to Japanese when specifying
|
|
| 1411 | - // preferNative to true, the latter is not. Since seeing ja-JP-macos
|
|
| 1412 | - // would be confusing anyway, we treat it as a special case.
|
|
| 1413 | - // See tor-browser#41372 and Bug 1726586.
|
|
| 1414 | - name =
|
|
| 1415 | - Services.intl.getLocaleDisplayNames(undefined, ["ja"], {
|
|
| 1416 | - preferNative: true,
|
|
| 1417 | - })[0] + " (ja)";
|
|
| 1418 | - } else {
|
|
| 1419 | - name += ` (${code})`;
|
|
| 1420 | - }
|
|
| 1421 | - return {
|
|
| 1422 | - code,
|
|
| 1423 | - name,
|
|
| 1424 | - };
|
|
| 1425 | - });
|
|
| 1426 | - // tor-browser#42335: Sort language codes independently from the locale,
|
|
| 1427 | - // so do not use localeCompare.
|
|
| 1428 | - locales.sort((a, b) => a.code > b.code);
|
|
| 1405 | + let locales = available.map((code, i) => ({ code, name: localeNames[i] }));
|
|
| 1406 | + locales.sort((a, b) => a.name > b.name);
|
|
| 1429 | 1407 | |
| 1430 | 1408 | let fragment = document.createDocumentFragment();
|
| 1431 | 1409 | for (let { code, name } of locales) {
|