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:
Silent Mode 2026-10-01 00:59:23 +02:00
parent 596ea09fc7
commit deae55647c
2 changed files with 49 additions and 31 deletions

37
main.js
View file

@ -4058,32 +4058,39 @@ ipcMain.handle("tab-context-menu-popup", (e, tabId, rect) => {
// (languageMode="show", follow OS) or a specific BCP-47 tag
// (languageMode="manual", languageValue=<tag>). One truth source, two entry
// points. Applied via applyAcceptLanguage() + applyFingerprintAll() below.
// Labels are the language's own name in its own script — no BCP-47 tag in
// the label. The tag only surfaces as the 2-letter code on the URL-bar chip
// once picked. English is the UK original (en-GB); the US variant is 90%+
// the same text and shared the "EN" chip code, so it isn't a separate row.
// Labels are the language's own name in its own script — no BCP-47 tag in the
// label. The tag only surfaces as the 2-letter chip in the URL bar once picked.
// Only the original of each language: English is UK (en-GB), Spanish is Spain
// (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 = [
// European (ranked by global speakers)
{ tag: "en-GB", label: "English" },
{ tag: "es-ES", label: "Español" },
{ tag: "pt-BR", label: "Português (Brasil)" },
{ tag: "fr-FR", label: "Français" },
{ tag: "pt-PT", label: "Português" },
{ tag: "ru-RU", label: "Русский" },
{ tag: "de-DE", label: "Deutsch" },
{ 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: "ar", label: "العربية" },
{ tag: "he-IL", label: "עברית" },
{ tag: "pl-PL", label: "Polski" },
{ tag: "nl-NL", label: "Nederlands" },
{ 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-TW", label: "中文(繁體)" },
{ tag: "ja-JP", label: "日本語" },
{ tag: "ko-KR", label: "한국어" },
{ tag: "hi-IN", label: "हिन्दी" },
{ tag: "vi-VN", label: "Tiếng Việt" },
{ tag: "th-TH", 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: "中文(繁體)" },
];
function setWebsiteLanguage(mode, value) {
if (mode === "show") {

View file

@ -979,25 +979,36 @@
// row edits. "Auto" = languageMode="show" (follow OS); anything else
// switches to languageMode="manual" and pins languageValue.
// Same list the toolbar globe menu uses (kept in sync with
// WEBSITE_LANGUAGE_QUICK in main.js). Language name in its own script;
// the BCP-47 tag only surfaces as the 2-letter chip in the URL bar once
// picked, never in the picker. English is the UK original (en-GB) —
// the US variant is 90%+ the same text and shared "EN" anyway.
// WEBSITE_LANGUAGE_QUICK in main.js). Only the original of each language
// — English UK, Spanish Spain, Portuguese Portugal. Ordered by global
// speakers, European languages first.
const WEB_LANG_QUICK = [
// European (ranked by global speakers)
{ tag: "en-GB", label: "English" },
{ tag: "es-ES", label: "Español (España)" }, { tag: "es-MX", label: "Español (México)" },
{ tag: "pt-BR", label: "Português (Brasil)" }, { tag: "pt-PT", label: "Português (Portugal)" },
{ tag: "fr-FR", label: "Français" }, { tag: "de-DE", label: "Deutsch" },
{ tag: "it-IT", label: "Italiano" }, { tag: "nl-NL", label: "Nederlands" },
{ tag: "es-ES", label: "Español" },
{ tag: "fr-FR", label: "Français" },
{ tag: "pt-PT", label: "Português" },
{ tag: "ru-RU", label: "Русский" },
{ tag: "pl-PL", label: "Polski" }, { tag: "cs-CZ", label: "Čeština" },
{ tag: "sv-SE", label: "Svenska" }, { tag: "fi-FI", label: "Suomi" },
{ tag: "tr-TR", label: "Türkçe" }, { tag: "el-GR", label: "Ελληνικά" },
{ tag: "he-IL", label: "עברית" }, { tag: "ar", label: "العربية" },
{ tag: "hi-IN", label: "हिन्दी" }, { tag: "zh-CN", label: "中文(简体)" },
{ tag: "zh-TW", label: "中文(繁體)" }, { tag: "ja-JP", label: "日本語" },
{ tag: "ko-KR", label: "한국어" }, { tag: "vi-VN", label: "Tiếng Việt" },
{ tag: "th-TH", label: "ไทย" }, { tag: "id-ID", label: "Bahasa Indonesia" },
{ tag: "de-DE", label: "Deutsch" },
{ tag: "it-IT", label: "Italiano" },
{ tag: "tr-TR", label: "Türkçe" },
{ tag: "pl-PL", label: "Polski" },
{ tag: "nl-NL", label: "Nederlands" },
{ 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: "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
// browser Intl. Used for the "Automatic (…)" label so it reads as a