feat: localized instrument catalogs - #1
Merged
Conversation
Add per-locale catalogs under data/i18n/<lang>.json (27 locales). Each is a complete, drop-in catalog with the same shape and instrument IDs as data/instruments.json, with localized name/shortname (falling back to English where untranslated). - expose ./data/i18n/*.json via package exports - validate every locale catalog against the schema and assert ID/order parity with the English catalog - document localized usage in the README and add locale catalog tests Generated by instruments-meta's sync-public-instruments script.
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.
What
Adds localized instrument names to the public catalog. Every non-English locale ships as a complete, drop-in catalog under
data/i18n/<lang>.json— 27 locales.Each locale file has the exact same shape and instrument IDs (same order) as
data/instruments.json; onlyname/shortname(and group names) are localized, falling back to English wherever no translation exists. Consumers load the single file for their locale — nothing to merge.Changes
data/i18n/*.json— 27 localized catalogs (da, de, en-GB, es, fi, fil, fr, fr-CA, hi, id, it, ja, ja-HIRA, ko, ms, nb, nl, pl, pt, pt-BR, ro, ru, sv, tr, zh-Hans, zh-HK, zh-TW).package.json— expose./data/i18n/*.jsonvia the exports map.scripts/validate.mjs— validate every locale catalog against the JSON Schema and assert it exposes the same instrument IDs, in the same order, as the English catalog.README.md— document localized usage.test/i18n.test.mjs— structural-parity + real-translation tests.The English
data/instruments.jsonand the runtime JS API are unchanged.Source
These files are generated from
instruments-meta's localized fixtures via itssync-public-instrumentsscript (separate GitLab change). To regenerate:pnpm sync-publicfrominstruments-meta.Verification
pnpm validate→205 instruments / 11 groups, plus 27 localized catalogspnpm test→ 12 passed