Repository navigation
Replies: 4 comments 2 replies
|
Supporting this proposal from the Turkish language-pack side ( Current state (from the shipped
So the missing piece is exactly what you describe: a user-ordered array. Fallback machinery and per-locale dictionary registration ( Compatibility notes that would keep existing packs working:
Testing offer: our pack is 100% translated (64 namespaces / 2,910 keys), so it is a clean positive case; we can also produce a deliberately partial Turkish fixture (e.g. 60% keys) plus a plugin namespace registered only in en/zh to reproduce the "Chinese island" symptom and validate |
|
Update: I prepared a concrete draft for this proposal (not a submitted PR — upstream does not accept external PRs) plus a fixture. Both are public:
Key choices in the draft, matching the compatibility notes above:
Caveats: no pnpm checkout/toolchain was available in the environment where I produced this, so the updated tests and TypeScript are unverified — the hunks were applied programmatically against the tag sources only. Happy to iterate on the patch, or hand the fixture to whoever writes the real one. |
|
Validation update on the draft:
Still pending on my side: running the updated specs through the repository's own vitest/tsc (no checkout/toolchain in the environment where the draft was produced). The patch and report are linked from the repository README if anyone wants to pick it up. |
|
Thanks for pulling thirty-odd threads into one place — and for using the numbers from #10709. Three measurements from a pack that ships against the current model (594 namespaces, 69 177 strings, Per release. Layer 2, as observed in the vendored dictionaries. Of the 522 plugin dictionaries in the pack, the majority are authored with Chinese keys: a string such as A correction to layer 3, from the tree rather than from the issue list. The desktop shell is not English-only for every non-zh locale. Plugin manifests remain the one layer with no channel. Titles and one-liners live in package metadata outside every namespace. One more fact that bears on the shipped set: If it is useful, I can answer questions about any of the numbers above. |
Uh oh!
There was an error while loading. Please reload this page.
Locale preference should be an ordered list, not a single value
TL;DR. Today the UI locale is one value out of a fixed set (
zh,en), and every missing string falls back to English and then to the raw dictionary key — which, for plugin-supplied text, is usually Chinese. Replace the single select with an ordered list of languages (the way browsers doAccept-Language). Lookup then walks that list per key. A Russian user getsru → en → zh; a Ukrainian useruk → ru → en → zh; a Chinese userzh → enand sees no change at all. This unblocks every "add locale X" proposal below, because a partial translation becomes immediately usable instead of producing a Chinese/English patchwork.What the fallback chain looks like today
Three different layers, three different answers — which is exactly why the proposals below keep re-litigating it:
en, then the raw keyFALLBACK_LOCALE = 'en'andLOCALE_IDS = ['zh', 'en']as hardcoded; #4558 describes the lookup chain asns → common → en → key中文in the middle of an English or Russian UIlocale/ru.json), #9746, #10148, #9329So the complaint "I turned on a second language and got Chinese characters" is not one bug but the intersection of these three:
For someone who reads English but not Chinese, today's outcome is the worst of both: an interface that is partly their language, partly English, and partly Chinese.
Proposal
locale.preferencebecomes an ordered array instead of a single id. The settings UI shows it as a reorderable list with add/remove (a language picker plus up/down or drag), exactly like a browser's language settings.en, then the raw key). No key changes meaning; no dictionary format changes.LOCALE_IDSstops being a closed set of choices. It becomes "dictionaries shipped by this build"; selectable values are whatever dictionaries are registered at runtime (this is the same direction as 消除硬编码的两语言假设,使发行语言集合成为单一可配置来源 #3828 and Feature request: let community plugins register new UI languages (i18n) #4558 — please treat those two as the prerequisite, not as competing proposals).Accept-Language; keep the whole ordered list instead of narrowing it to the first match, which also fixes the "es-AR served as Arabic" ([Bug] report: DeepSeek UI served in Arabic when browser locale is es-AR / es_AR #11688) and "fr-be served as Belarusian" ([Bug] Locale `fr-be` (Belgian French) incorrectly served as Belarusian (`be`) UI #6133) class of bugs.zhfirst, behaviour is identical to today.Why this is worth doing before more locales are merged: every proposal listed below ships one more dictionary and then faces the same complaint — a translated UI with untranslated islands, where the island language depends on which layer missed the key. An ordered list makes the island language a user choice (English before Chinese, or no Chinese at all), and it makes partial packs useful on the day they land instead of "complete enough" only at 100%.
The change surface is small: the settings schema (string → ordered array), one lookup loop, and one settings widget. It does not require touching 26 packages'
locales.tsfiles (#3828 does that work separately).Related discussions
Same proposal, different layer (prerequisites):
locale/ru.json(0 of 222)Built-in locale proposals (all would benefit from an ordered preference rather than another single choice):
Language packs already shipped by the community:
Observable symptoms this would fix or make user-controlled:
Notes
packages/client/locale. Since patches are not accepted in this repository, I am raising it as a discussion; a downstream fork already needs exactly this because our own plugins shipen/rudictionaries on top of Chinese source keys.All reactions