Theseus 0.3.61: language picker — merge regional variants, sort by speakers
Sits on top of the earlier 0.3.61 commit (bundled into the same shipped build): Spanish and Portuguese collapse to their originals — es-ES and pt-PT — and the Mexican / Brazilian variants come off the picker (same 2-letter chip, roughly the same text). Ordering is now global-speakers ranking with European languages first, so the languages a European desktop is most likely to want sit at the top: English, Español, Français, Português, Русский, Deutsch, Italiano, Türkçe, Polski, Nederlands, Ελληνικά, Čeština, Svenska, Suomi — then the non-European tier led by 中文, हिन्दी, العربية and so on.
This commit is contained in:
parent
596ea09fc7
commit
deae55647c
2 changed files with 49 additions and 31 deletions
37
main.js
37
main.js
|
|
@ -4058,32 +4058,39 @@ ipcMain.handle("tab-context-menu-popup", (e, tabId, rect) => {
|
||||||
// (languageMode="show", follow OS) or a specific BCP-47 tag
|
// (languageMode="show", follow OS) or a specific BCP-47 tag
|
||||||
// (languageMode="manual", languageValue=<tag>). One truth source, two entry
|
// (languageMode="manual", languageValue=<tag>). One truth source, two entry
|
||||||
// points. Applied via applyAcceptLanguage() + applyFingerprintAll() below.
|
// points. Applied via applyAcceptLanguage() + applyFingerprintAll() below.
|
||||||
// Labels are the language's own name in its own script — no BCP-47 tag in
|
// Labels are the language's own name in its own script — no BCP-47 tag in the
|
||||||
// the label. The tag only surfaces as the 2-letter code on the URL-bar chip
|
// label. The tag only surfaces as the 2-letter chip in the URL bar once picked.
|
||||||
// once picked. English is the UK original (en-GB); the US variant is 90%+
|
// Only the original of each language: English is UK (en-GB), Spanish is Spain
|
||||||
// the same text and shared the "EN" chip code, so it isn't a separate row.
|
// (es-ES), Portuguese is Portugal (pt-PT). Regional variants are the same 2-
|
||||||
|
// letter chip and ~same text, so they aren't separate rows. Ordered by global
|
||||||
|
// speakers, European languages first.
|
||||||
const WEBSITE_LANGUAGE_QUICK = [
|
const WEBSITE_LANGUAGE_QUICK = [
|
||||||
|
// European (ranked by global speakers)
|
||||||
{ tag: "en-GB", label: "English" },
|
{ tag: "en-GB", label: "English" },
|
||||||
{ tag: "es-ES", label: "Español" },
|
{ tag: "es-ES", label: "Español" },
|
||||||
{ tag: "pt-BR", label: "Português (Brasil)" },
|
|
||||||
{ tag: "fr-FR", label: "Français" },
|
{ tag: "fr-FR", label: "Français" },
|
||||||
|
{ tag: "pt-PT", label: "Português" },
|
||||||
|
{ tag: "ru-RU", label: "Русский" },
|
||||||
{ tag: "de-DE", label: "Deutsch" },
|
{ tag: "de-DE", label: "Deutsch" },
|
||||||
{ tag: "it-IT", label: "Italiano" },
|
{ tag: "it-IT", label: "Italiano" },
|
||||||
{ tag: "nl-NL", label: "Nederlands" },
|
|
||||||
{ tag: "ru-RU", label: "Русский" },
|
|
||||||
{ tag: "pl-PL", label: "Polski" },
|
|
||||||
{ tag: "tr-TR", label: "Türkçe" },
|
{ tag: "tr-TR", label: "Türkçe" },
|
||||||
{ tag: "ar", label: "العربية" },
|
{ tag: "pl-PL", label: "Polski" },
|
||||||
{ tag: "he-IL", label: "עברית" },
|
{ tag: "nl-NL", label: "Nederlands" },
|
||||||
{ tag: "el-GR", label: "Ελληνικά" },
|
{ tag: "el-GR", label: "Ελληνικά" },
|
||||||
|
{ tag: "cs-CZ", label: "Čeština" },
|
||||||
|
{ tag: "sv-SE", label: "Svenska" },
|
||||||
|
{ tag: "fi-FI", label: "Suomi" },
|
||||||
|
// Non-European (ranked by global speakers)
|
||||||
{ tag: "zh-CN", label: "中文(简体)" },
|
{ tag: "zh-CN", label: "中文(简体)" },
|
||||||
{ tag: "zh-TW", label: "中文(繁體)" },
|
|
||||||
{ tag: "ja-JP", label: "日本語" },
|
|
||||||
{ tag: "ko-KR", label: "한국어" },
|
|
||||||
{ tag: "hi-IN", label: "हिन्दी" },
|
{ tag: "hi-IN", label: "हिन्दी" },
|
||||||
{ tag: "vi-VN", label: "Tiếng Việt" },
|
{ tag: "ar", label: "العربية" },
|
||||||
{ tag: "th-TH", label: "ไทย" },
|
|
||||||
{ tag: "id-ID", label: "Bahasa Indonesia" },
|
{ tag: "id-ID", label: "Bahasa Indonesia" },
|
||||||
|
{ tag: "ja-JP", label: "日本語" },
|
||||||
|
{ tag: "vi-VN", label: "Tiếng Việt" },
|
||||||
|
{ tag: "ko-KR", label: "한국어" },
|
||||||
|
{ tag: "th-TH", label: "ไทย" },
|
||||||
|
{ tag: "he-IL", label: "עברית" },
|
||||||
|
{ tag: "zh-TW", label: "中文(繁體)" },
|
||||||
];
|
];
|
||||||
function setWebsiteLanguage(mode, value) {
|
function setWebsiteLanguage(mode, value) {
|
||||||
if (mode === "show") {
|
if (mode === "show") {
|
||||||
|
|
|
||||||
|
|
@ -979,25 +979,36 @@
|
||||||
// row edits. "Auto" = languageMode="show" (follow OS); anything else
|
// row edits. "Auto" = languageMode="show" (follow OS); anything else
|
||||||
// switches to languageMode="manual" and pins languageValue.
|
// switches to languageMode="manual" and pins languageValue.
|
||||||
// Same list the toolbar globe menu uses (kept in sync with
|
// Same list the toolbar globe menu uses (kept in sync with
|
||||||
// WEBSITE_LANGUAGE_QUICK in main.js). Language name in its own script;
|
// WEBSITE_LANGUAGE_QUICK in main.js). Only the original of each language
|
||||||
// the BCP-47 tag only surfaces as the 2-letter chip in the URL bar once
|
// — English UK, Spanish Spain, Portuguese Portugal. Ordered by global
|
||||||
// picked, never in the picker. English is the UK original (en-GB) —
|
// speakers, European languages first.
|
||||||
// the US variant is 90%+ the same text and shared "EN" anyway.
|
|
||||||
const WEB_LANG_QUICK = [
|
const WEB_LANG_QUICK = [
|
||||||
|
// European (ranked by global speakers)
|
||||||
{ tag: "en-GB", label: "English" },
|
{ tag: "en-GB", label: "English" },
|
||||||
{ tag: "es-ES", label: "Español (España)" }, { tag: "es-MX", label: "Español (México)" },
|
{ tag: "es-ES", label: "Español" },
|
||||||
{ tag: "pt-BR", label: "Português (Brasil)" }, { tag: "pt-PT", label: "Português (Portugal)" },
|
{ tag: "fr-FR", label: "Français" },
|
||||||
{ tag: "fr-FR", label: "Français" }, { tag: "de-DE", label: "Deutsch" },
|
{ tag: "pt-PT", label: "Português" },
|
||||||
{ tag: "it-IT", label: "Italiano" }, { tag: "nl-NL", label: "Nederlands" },
|
|
||||||
{ tag: "ru-RU", label: "Русский" },
|
{ tag: "ru-RU", label: "Русский" },
|
||||||
{ tag: "pl-PL", label: "Polski" }, { tag: "cs-CZ", label: "Čeština" },
|
{ tag: "de-DE", label: "Deutsch" },
|
||||||
{ tag: "sv-SE", label: "Svenska" }, { tag: "fi-FI", label: "Suomi" },
|
{ tag: "it-IT", label: "Italiano" },
|
||||||
{ tag: "tr-TR", label: "Türkçe" }, { tag: "el-GR", label: "Ελληνικά" },
|
{ tag: "tr-TR", label: "Türkçe" },
|
||||||
{ tag: "he-IL", label: "עברית" }, { tag: "ar", label: "العربية" },
|
{ tag: "pl-PL", label: "Polski" },
|
||||||
{ tag: "hi-IN", label: "हिन्दी" }, { tag: "zh-CN", label: "中文(简体)" },
|
{ tag: "nl-NL", label: "Nederlands" },
|
||||||
{ tag: "zh-TW", label: "中文(繁體)" }, { tag: "ja-JP", label: "日本語" },
|
{ tag: "el-GR", label: "Ελληνικά" },
|
||||||
{ tag: "ko-KR", label: "한국어" }, { tag: "vi-VN", label: "Tiếng Việt" },
|
{ tag: "cs-CZ", label: "Čeština" },
|
||||||
{ tag: "th-TH", label: "ไทย" }, { tag: "id-ID", label: "Bahasa Indonesia" },
|
{ tag: "sv-SE", label: "Svenska" },
|
||||||
|
{ tag: "fi-FI", label: "Suomi" },
|
||||||
|
// Non-European (ranked by global speakers)
|
||||||
|
{ tag: "zh-CN", label: "中文(简体)" },
|
||||||
|
{ tag: "hi-IN", label: "हिन्दी" },
|
||||||
|
{ tag: "ar", label: "العربية" },
|
||||||
|
{ tag: "id-ID", label: "Bahasa Indonesia" },
|
||||||
|
{ tag: "ja-JP", label: "日本語" },
|
||||||
|
{ tag: "vi-VN", label: "Tiếng Việt" },
|
||||||
|
{ tag: "ko-KR", label: "한국어" },
|
||||||
|
{ tag: "th-TH", label: "ไทย" },
|
||||||
|
{ tag: "he-IL", label: "עברית" },
|
||||||
|
{ tag: "zh-TW", label: "中文(繁體)" },
|
||||||
];
|
];
|
||||||
// "English" for a locale tag ("en-US" → "English", "de-DE" → "German") via
|
// "English" for a locale tag ("en-US" → "English", "de-DE" → "German") via
|
||||||
// browser Intl. Used for the "Automatic (…)" label so it reads as a
|
// browser Intl. Used for the "Automatic (…)" label so it reads as a
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue