Migrate translations from Crowdin to General Translation - #2660
Migrate translations from Crowdin to General Translation#2660jarvisonsmart wants to merge 4 commits into
Conversation
Restructure packages/localization into locales/<locale>/<group>.json with a single merged English source (en-base won both drifted values), generated translation catalogs (no more runtime unflatten), and a separate module for not-yet-enabled locales so they stay out of the app bundle. Replace i18n-js with i18next (keySeparator: false keeps all call sites unchanged), unify the dev/en_dev locale naming, and add proper plural forms for count-based keys. Notification service now uses a typed flat-catalog lookup. Crowdin config and sync workflow are replaced by a General Translation CI workflow that machine-translates new English strings and opens a sync PR. A check:translations guard validates locale files and codegen freshness in CI.
|
Too many files changed for review (511 files, 100 file limit). |
|
Important Review skippedToo many files! This PR contains 493 files, which is 393 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (18)
📒 Files selected for processing (493)
You can disable this status message by setting the 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 |
📱 Preview on the staging appOpen Vexl (stage) → Account → Scan QR code and scan this: Preview link:
The preview only loads into staging builds with a matching runtime — if this PR changes native code, ship a new staging build first. To go back to the staging channel: debug screen → "Clear PR preview". |
Register existing human translations on the GT platform (so they are never machine-retranslated), machine-translate the missing keys for active locales (plural forms and pre-existing gaps), and add hand-written Czech/Slovak/Polish _few/_many plural forms that GT cannot derive from the English _one/_other source. Adds iOS infoPlist permission strings for nl, sw, and zh and wires them into the app config. Commits gt-lock.json so CI sync PRs track local edits correctly.
Run gt translate with --save-local in CI so locale-file corrections committed to git are uploaded to the General Translation platform instead of being overwritten by the next sync. Add a nightly schedule so dashboard-side edits reach the repo without waiting for an English string change. Update docs to match.
Documents the English-only workflow (pick the right group file, run pnpm generate, never run gt commands) for coding agents, with a .claude/skills symlink so Claude Code picks it up.
Migrates the translation pipeline from Crowdin to General Translation and modernizes the whole i18n setup along the way.
What changed
Translation files restructured (
packages/localization)base.json(plus 23<lang>-base.jsonsiblings) is split intolocales/<locale>/<group>.json— 15 thematic group files (offers, marketplace, chat, contacts, settings, …). Keys keep their full dotted names, so no call site changed.base.jsonvsen-base.jsondual-source-of-truth is gone: they were merged into a single English source (locales/en/), withen-base.jsonwinning the two drifted values (notifications.TRADE_REMINDER.title,messages.readAt).src/translations.tsis now generated (pnpm generate) — flat catalogs, no more runtimeunflattenwith the type-level lie. Disabled locales (ar, fa, fi, id, no, pcm, sv, tr, uk) live in a separate generatedsrc/extraTranslations.tsso Metro never bundles them; enabling one later means moving it to theAPP_LOCALESlist inscripts/generateTranslations.mjs.infoPliststrings moved into the same per-locale layout.i18n-js → i18next (
apps/mobile)I18nProvidernow builds i18next instances withkeySeparator: false, so the flat dotted keys are used as-is — all ~1,850t()call sites are untouched, including dynamic template-literal keys.'dev'vs'en_dev'locale-name mismatch (onedevAwareLng()helper; the persisted settings value stays'dev').[missing …]marker.intl-pluralrulespolyfill (Hermes lacksIntl.PluralRules) and converted 6{{count}}keys to proper_one/_otherplural forms — Slavic locales get correct plurals once translations sync. More candidates are listed in the migration notes for follow-up.getNotificationContentByLocaleis now a typed flat-catalog lookup (noany, no@ts-expect-error, no try/catch).Crowdin → General Translation
crowdin.yml+ nightly Crowdin workflow deleted; zero crowdin references remain..github/workflows/translate.yaml: on push tomaintouchinglocales/en/**(or manual dispatch), runsgt translate+pnpm generateand opens/updates achore/translations-syncPR. Translated files stay committed in git; the hosted API is only the translation engine.check:translations(wired into test-lint CI): validates locale JSON, orphan keys (plural-aware), empty English values (2 legacy warnings), and codegen freshness.packages/localization/AGENTS.mdanddocs/how_to_help_translate.md(filename typo fixed; Crowdin screenshots removed, Translators Debug Mode guide kept).What still needs doing (not blocking review)
GT_API_KEY(must be a production key — the dev key can't call the translation API; generate vianpx gt auth -t production) andGT_PROJECT_ID; theCROWDIN_*secrets can be deleted.translate.yamlmanually (or rungt translatelocally with the production key). This fills the new plural forms in all locales (until then those 6 keys render English via fallback) and the small pre-existing gaps. The run should preserve existing human translations (CLI docs: local edits are kept unless source changed) — worth eyeballing the first sync PR diff to confirm.pcm(Nigerian Pidgin) is not supported by GT — its files remain committed and validated but won't receive updates; decide later whether to drop it or translate it another way.Notification-service jest failures in local runs are pre-existing environment issues (
PgClient: Failed to connect— tests need the CI Postgres); mobile suite passes (221 tests), fullturbo:typecheck/format/lintpass across all 29 workspaces.