chore(locales): sync locale files with source strings - #151
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #151 +/- ##
=======================================
Coverage 36.25% 36.25%
=======================================
Files 115 115
Lines 4281 4281
Branches 1034 1034
=======================================
Hits 1552 1552
Misses 2523 2523
Partials 206 206 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
EdgeTX Buddy has been automatically deployed to Cloudflare. |
bdb2417 to
e44cad3
Compare
Removes two stale keys from flashing.json in all 11 locales ("Flash"
and "Flash this radio via Bootloader and UF2") — both were dropped
from source in the UF2 flashing PR (#133) without pruning the locale
entries. Note this discards their existing translations, including a
hand-written Chinese one; if the strings ever return to source they
will need re-translating.
Adds three missing keys to backup.json in 10 locales (zh already had
them translated) that were introduced by the backup feature (#134)
but only partially propagated.
Output of `yarn extract-locales`, verified idempotent.
No content change (identical keys and values) — resorts three keys added at the file tail by #140 into canonical positions and replaces the "—" JSON escape with a literal em dash, so running `yarn extract-locales` is now a complete no-op across all locale files.
Added in #134 but doubly unused: the extractor excludes en from its locales list (English lives in the t() source strings via useKeysAsDefaultValue), and the runtime i18n loader short-circuits en with an empty resource object, so the file was never read. It had already drifted to carry 21 keys that no longer exist in source.
0c9b518 to
b79a335
Compare
Rebasing onto main pulled in 5d4279b, which changed the JSX inside CompatNoticeModal.tsx's <Trans> block and shifted its interpolation indices (<1>/<3> -> <2>/<6>), invalidating the translated string for that key across all 11 locales. Also re-sorts sv/backup.json and sv/flashing.json to match extractor collation order (values unchanged). Verified: yarn extract-locales is now a no-op, yarn vitest run src/renderer passes 153/153, yarn test:types is clean. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Summary
Pure locale-JSON sync produced by
yarn extract-locales(no source changes). The drift had two causes:t(Flash)(replaced byFlash firmware) and dropped the UF2-only tooltipt(Flash this radio via Bootloader and UF2)from source, but the old keys were left behind inflashing.json. This PR removes both from all 11 locales. Note this discards their existing translations (including a hand-written Chinese one from chore: translated all the texts to Simplified Chinese #140); if the strings ever return to source they'll need re-translating.Radio settings — will be overwritten…,labels.yml is always included…,Select an SD Card to enable restore) that were only propagated tozh/backup.json(via chore: translated all the texts to Simplified Chinese #140). This PR adds them to the other 10 locales as untranslated English fallbacks, ready for translators.zh/backup.jsonneeded no key changes (it already had all three keys with real translations from #140), but is normalized to canonical extractor output in a follow-up commit — three keys resorted into sorted positions and a\u2014escape replaced with a literal em dash — so thatyarn extract-localesis now a complete no-op across every locale file.Verification
src/ande2e/(all otherFlash …keys survive)t()call sites exactly (namespacebackup)yarn vitest run src/renderer— 152/152 tests passyarn test:types— no errorsyarn extract-localesis a no-op on these 21 files (sync is idempotent)Also deleted: orphaned
locales/en/backup.jsonThis file (added in #134) was doubly unused:
i18next-parser.config.jsfiltersenout of the extractor's locales list (languages.filter((lang) => lang !== "en")) because English is the built-in default —useKeysAsDefaultValue: truemakes thet()source strings themselves the English text — and the runtime loader (LazyImportPlugin.ts) short-circuitsenwith an empty resource object, so no English JSON is ever loaded. Nothing read it, nothing maintained it, and it had already drifted to carry 21 keys that no longer exist in source. Verified no references anywhere insrc/,e2e/,webpack/, or Storybook config before deleting.Heads-up: this touches lines adjacent to changes in #150, so whichever merges second may hit a trivial conflict in
flashing.json.🤖 Generated with Claude Code