This is an automated email from the git hooks/post-receive script.
pierov pushed a commit to branch tor-browser-102.4.0esr-12.0-1 in repository tor-browser.
The following commit(s) were added to refs/heads/tor-browser-102.4.0esr-12.0-1 by this push: new e3bef662e97c Bug 41369: Improve Firefox language settings for multi-lingual packages e3bef662e97c is described below
commit e3bef662e97cb9562498460db3ec8f344c744d74 Author: Pier Angelo Vendrame pierov@torproject.org AuthorDate: Tue Oct 18 19:02:18 2022 +0200
Bug 41369: Improve Firefox language settings for multi-lingual packages
Change the language selector to be sorted by language code, rather than name, and to display the language code to the user.
Bug 41372: Handle Japanese as a special case in preferences on macOS
Japanese is treated in a special way on macOS. However, seeing the Japanese language tag could be confusing for users, and moreover the language name is not localized correctly like other langs. --- browser/components/preferences/main.js | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/browser/components/preferences/main.js b/browser/components/preferences/main.js index ecdf42cd98c8..7586816a0450 100644 --- a/browser/components/preferences/main.js +++ b/browser/components/preferences/main.js @@ -1013,8 +1013,28 @@ var gMainPane = { available, { preferNative: true } ); - let locales = available.map((code, i) => ({ code, name: localeNames[i] })); - locales.sort((a, b) => a.name > b.name); + 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, + }) + " (ja)"; + } else { + name += ` (${code})`; + } + return { + code, + name, + }; + }); + locales.sort((a, b) => a.code.localeCompare(b.code));
let fragment = document.createDocumentFragment(); for (let { code, name } of locales) {
tbb-commits@lists.torproject.org