From f4514946bdb3f008f744888f2f099a950d6c221a Mon Sep 17 00:00:00 2001 From: Silent Mode Date: Thu, 1 Oct 2026 22:14:38 +0200 Subject: [PATCH] Theseus 0.3.62: picker says just "English", not "American English" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Intl.DisplayNames.of("en-US") returns "American English", which spells out a distinction the picker doesn't make — one row per language, with English the UK original. Pass the base code to Intl so the chip tooltip, the "Automatic (…)" label and the Settings hint all read as the plain language name (English, Russian, Portuguese, Chinese) regardless of which regional variant the OS or the saved setting happens to be. --- chrome.html | 6 +++++- main.js | 9 ++++++--- package.json | 2 +- settings.html | 9 +++++---- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/chrome.html b/chrome.html index 366df2f4..dad59d93 100644 --- a/chrome.html +++ b/chrome.html @@ -724,7 +724,11 @@ let systemLocaleCached = "en-US"; function short(tag) { return String(tag || "").split("-")[0].toUpperCase().slice(0, 2) || "??"; } function langName(tag) { - try { return new Intl.DisplayNames(["en"], { type: "language" }).of(tag) || tag; } + // Base language only: "en-US" → "English", not "American English". The + // picker's one row per language already encodes "which English"; the chip + // tooltip just needs the plain name. + const base = String(tag || "").split("-")[0]; + try { return new Intl.DisplayNames(["en"], { type: "language" }).of(base) || tag; } catch { return tag; } } function renderLang(s) { diff --git a/main.js b/main.js index 05429002..59ed69f7 100644 --- a/main.js +++ b/main.js @@ -4108,10 +4108,13 @@ function setWebsiteLanguage(mode, value) { applyAcceptLanguage(); try { chrome?.webContents.send("settings-update", settings); } catch {} } -// Human-readable name for a BCP-47 tag ("de" → "German") via V8 Intl. -// Falls back to the tag itself if the locale isn't recognised. +// Human-readable name for a BCP-47 tag — the plain language name, no regional +// qualifier ("en-US" → "English", not "American English"). The picker only +// shows one entry per language, so the regional half of a tag is noise in +// labels; pass the base ("en") to Intl.DisplayNames to get the clean name. function languageNameFor(tag) { - try { return new Intl.DisplayNames(["en"], { type: "language" }).of(tag) || tag; } + const base = String(tag || "").split("-")[0]; + try { return new Intl.DisplayNames(["en"], { type: "language" }).of(base) || tag; } catch { return tag; } } ipcMain.handle("system-locale", () => app.getLocale() || "en-US"); diff --git a/package.json b/package.json index 7046928b..e51c0102 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.61", + "version": "0.3.62", "license": "MPL-2.0", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode", diff --git a/settings.html b/settings.html index 91dfc4c6..a067bc89 100644 --- a/settings.html +++ b/settings.html @@ -1013,11 +1013,12 @@ { 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 - // language name rather than a raw tag. + // Plain language name for a locale tag — no regional qualifier so en-US + // reads as "English", not "American English" (one picker row per language, + // so the regional half is noise). Pass just the base to Intl.DisplayNames. const langNameFor = (tag) => { - try { return new Intl.DisplayNames(["en"], { type: "language" }).of(tag) || tag; } + const base = String(tag || "").split("-")[0]; + try { return new Intl.DisplayNames(["en"], { type: "language" }).of(base) || tag; } catch { return tag; } }; (async () => {