# Ordered-locale fixtures Fixture data for the ordered locale preference proposal ([Discussion #11699](https://github.com/deepseek-ai/deepseek-harness/discussions/11699)) and the draft patch in [`../patches/`](../patches/README.md). ## Files | File | Purpose | |---|---| | `tr-partial.json` | Deterministic **59.4 %** subset of the Turkish dictionaries (`1728 / 2910` keys, 64 namespaces), same shape as the language pack's `locales/tr.json`. Generated by `tools/make_tr_partial_fixture.py` in the project workspace. | | `expected-behavior.json` | Coverage summary, the chains compared, and sample keys with the value each chain returns. | | `version-coverage.json` | Machine-readable version delta: the fixture is based on `dsh-v0.2.1-rc.3`; the installed `dsh-v0.2.2-rc.1` adds 10 namespaces / 981 strings (measured from the updated app), none covered here, so those strings exercise the English fallback. | ## Version coverage The fixture is deliberately a **59.4 % Turkish subset of `0.2.1-rc.3`**, not a complete 0.2.2 pack. The installed **0.2.2-rc.1** was re-extracted and measured: ten new namespaces (`forgePanel` 253, `liveshare` 225, `stats` 177, `creationRecommendations` 55, `pluginRecommendations` 25, `actionCards` 14, `fileActions` 12, `contextMenu` 1, `fileDrag` 1, `messageQuotes` 1) plus 217 keys inside existing namespaces — **981 strings** (52 removed, 60 changed English values). A fixture-based test therefore sees those strings fall through to English, which is exactly the ordered-list behaviour under test. See `version-coverage.json`. ## What it demonstrates - **Partial packs become useful.** With `preference: ["tr"]` today the missing ~40 % falls through to `en`; with an ordered list the same fallback applies but the user controls the order, e.g. `["tr", "en"]` (Turkish first, English islands) versus `["en", "tr"]` (English everywhere). - **Order is meaningful.** A key that both dictionaries own answers from the first entry: `["tr", "en"]` → Turkish, `["en", "tr"]` → English. - **No Chinese leakage for this pack.** `tr` declares `en` as its fallback, so a missing Turkish key reaches English before any other language; adding `zh` to the list only matters for namespaces where English is absent. `expected-behavior.json` records the exact values for the samples so a test can assert both behaviours: ```json { "chains": { "today (single preference, language fallback)": ["tr", "en"], "ordered [tr, en]": ["tr", "en"], "ordered [en, tr]": ["en", "tr"], "ordered [tr, zh]": ["tr", "zh", "en"], "ordered [ru, en, zh]": ["ru", "en", "zh"] } } ``` ## Live demo The fixture was also built into a temporary language pack (`tr-partial`, label `Türkçe (kısmi)`) and installed in DSH 0.2.1-rc.3. Selecting it in **Settings → General → Language** renders the mixed UI directly — Turkish where the subset has a key, English islands where it falls back: ![Partial Turkish demo](https://github.com/mkfeyman/dsh-turkish-locale/raw/main/docs/partial-pack-demo.png) The demo pack was removed afterwards; the fixture and this screenshot remain. ## Layer-2 audit (Chinese-key leak detection) An ordered preference cannot fix a namespace that only registers `zh`: the raw Chinese key still shows. To measure that gap locally without sharing dictionary data, use the standalone audit: ```sh python tools/audit_locale_gaps.py ``` It reads `{namespace: {locale: {key: value}}}` and reports namespaces missing `en`, CJK keys that would leak, and typed (zh+en) vs per-locale counts. A small sample is at [`audit-sample.json`](audit-sample.json). Only the printed counts need to be shared back. ## Using it in tests The fixture is plain dictionary data; a test can load it and register the subsets as a language-pack plugin: ```ts const partial = JSON.parse(await readFile(new URL('./tr-partial.json', import.meta.url), 'utf8')) for (const [ns, dict] of Object.entries(partial)) locale.register(ns, 'tr', dict) locale.addLanguage({ id: 'tr', label: 'Türkçe', fallback: 'en' }) locale.setPreferences(['tr', 'en']) ``` To reproduce the currently shipped single-selection behaviour, call `locale.setLocale('tr')` instead and compare the rendered strings.