feat(strings): add canonical locales.json (RFC 0003) - #53
Merged
Conversation
Add Strings/locales.json — the canonical, machine-readable list of locales
DasherCore supports: {code, endonym, rtl} for all 33 locales that ship a
strings_*.json file. This is the single source of truth for every frontend's
locale picker, so they stop hardcoding divergent subsets (Apple 9, Windows 10,
GTK 0).
Pure data; no engine or API change. Generated to match the strings_*.json
files exactly (33 == 33; RTL: ar, fa, ur). Frontends codegen/bind their
pickers from this file (RFC 0003).
Follow-ups (separate): a CI guard that asserts locales.json stays in sync
with strings_*.json, and optionally a C API to query the list at runtime.
Signed-off-by: will wade <willwade@gmail.com>
Add tests/test_locales_sync.cpp: a doctest that fails if Strings/locales.json and the shipped strings_<code>.json files drift apart in either direction — a new strings_xx.json missing from locales.json, or a locales.json entry with no file. Registered via dasher_add_test, so it runs in every CI matrix job. Self-contained (no JSON dependency): codes come from the filenames and a focused scan of locales.json. Verified locally — passes at 33==33, and fails loudly with a diagnostic when a strings_*.json is removed (restored after). Signed-off-by: will wade <willwade@gmail.com>
willwade
added a commit
to dasher-project/Dasher-Apple
that referenced
this pull request
Aug 2, 2026
Updates the `DasherCore` submodule from **v0.2.1** (`541c6bc8`) to **v0.2.2** (`8bb4ed98`). **v0.2.2 adds** ([DasherCore #53](dasher-project/DasherCore#53)): - `Strings/locales.json` — the canonical locale list (code / endonym / rtl) for RFC 0003. - A CI sync-guard (`tests/test_locales_sync.cpp`) that fails if it drifts from `strings_*.json`. This unblocks the frontend localisation work (binding locale pickers to `locales.json`) on the feature branch. Submodule pointer only; no Dasher-Apple source changes. Signed-off-by: will wade <willwade@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the canonical locale list for DasherCore (RFC 0003) and a CI guard that keeps it in sync — the DasherCore-first step of the multilingual-UI work.
1.
Strings/locales.json— the locale SSOTDasherCore ships 33
strings_*.jsontranslation files but had no canonical list of those locales (code, endonym, RTL), so every frontend hardcoded its own subset picker (Apple 9, Windows 10, GTK 0) and they drifted.locales.jsonis the single source of truth those pickers read.{ "_comment", "locales": [ { "code", "endonym", "rtl" } ] }for all 33 shipped locales — generated from thestrings_*.jsonfilenames merged with the endonym/RTL table in RFC 0003. RTL flags:ar,fa,ur. Ordered by code; display ordering is the frontend's concern. Pure data; no engine or API change.2.
tests/test_locales_sync.cpp— drift guardA doctest that fails if
locales.jsonand the shippedstrings_<code>.jsonfiles drift apart in either direction — a newstrings_xx.jsonmissing fromlocales.json, or alocales.jsonentry with no file. Registered viadasher_add_test, so it runs in every CI matrix job.Self-contained (no JSON dependency): codes come from the filenames and a focused scan of
locales.json. Verified locally — passes at 33==33, and fails loudly with a diagnostic when astrings_*.jsonis removed.Out of scope (follow-ups)
dasher_get_locale_count/dasher_get_locale_info) — deferred until a frontend needs runtime access instead of codegen.Verification
json.loadsucceeds; 33 codes match the 33strings_*.jsonfilenames; the guard test builds and passes (and fails on simulated drift).