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 () => {