Skip to content

chore(locales): sync locale files with source strings - #151

Draft
pfeerick wants to merge 3 commits into
mainfrom
chore/sync-locales
Draft

chore(locales): sync locale files with source strings#151
pfeerick wants to merge 3 commits into
mainfrom
chore/sync-locales

Conversation

@pfeerick

@pfeerick pfeerick commented Jul 27, 2026

Copy link
Copy Markdown
Member

Summary

Pure locale-JSON sync produced by yarn extract-locales (no source changes). The drift had two causes:

zh/backup.json needed 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 \u2014 escape replaced with a literal em dash — so that yarn extract-locales is now a complete no-op across every locale file.

Verification

  • All changed files parse as valid JSON with no duplicate keys; key sets identical across all 11 locales for both namespaces
  • Removed keys confirmed to have zero references in src/ and e2e/ (all other Flash … keys survive)
  • Added keys confirmed to match their t() call sites exactly (namespace backup)
  • yarn vitest run src/renderer — 152/152 tests pass
  • yarn test:types — no errors
  • Re-running yarn extract-locales is a no-op on these 21 files (sync is idempotent)

Also deleted: orphaned locales/en/backup.json

This file (added in #134) was doubly unused: i18next-parser.config.js filters en out of the extractor's locales list (languages.filter((lang) => lang !== "en")) because English is the built-in default — useKeysAsDefaultValue: true makes the t() source strings themselves the English text — and the runtime loader (LazyImportPlugin.ts) short-circuits en with 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 in src/, 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

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.
@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6463fd6a-bff5-4ab5-bdb3-b2558c9bd30c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/sync-locales

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 34.95%. Comparing base (eb9b4d7) to head (0c9b518).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #151   +/-   ##
=======================================
  Coverage   34.95%   34.95%           
=======================================
  Files         115      115           
  Lines        4288     4288           
  Branches     1033     1033           
=======================================
  Hits         1499     1499           
  Misses       2585     2585           
  Partials      204      204           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown

EdgeTX Buddy has been automatically deployed to Cloudflare.
✅ Preview: https://85105ab4.buddy-7a6.pages.dev
✅ Storybook: https://85105ab4.buddy-7a6.pages.dev/storybook

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant