Rabby I18n Translation
Use this playbook when editing locale JSON files under:
_raw/locales/*/messages.json
When adding or removing a supported language, also update:
The browser extension manifest locale files under _raw/_locales/*/messages.json use Chrome message/description objects. Edit them only when the task explicitly targets extension manifest metadata, and preserve that object shape.
Scope
Backfill only leaf string keys where English has a non-empty value and the target locale either:
- does not have the key
- has the key with an empty string value
Do not rewrite existing non-empty translations during a missing-key backfill.
Skip Rules
Always evaluate __skip_translation before deciding what is missing.
__skip_translation: true
The entire object is excluded from translation. Do not add, translate, or count any descendant leaf key in that object.
__skip_translation: ["keyA", "keyB"]
The listed direct child keys are excluded from translation. Do not add, translate, or count those keys, including their descendants if a listed key is an object.
The __skip_translation marker itself is metadata.
Do not translate it, copy it into other locale files, or count it as a missing user-facing key.
Quality Rules
- Preserve interpolation placeholders exactly, such as
{{market}}, {{count}}, and numbered placeholders.
- Preserve React-i18next tags exactly, such as
<1>...</1> and named tags such as <bold>...</bold>.
- Keep product names and protocol terms stable unless the locale already has a consistent localized form.
- Keep common crypto abbreviations such as
APY, TVL, LTV, DeFi, DEX, NFT, RWA, TP, SL, and LIQ untranslated when they are intentionally marked as skipped or used as industry labels.
- Match the surrounding locale's tone and terminology before adding new translations.
Validation
After edits:
- Parse every
_raw/locales/*/messages.json file with JSON.parse.
- Compare every non-skipped English leaf string against each target locale and verify no non-skipped key is missing or empty.
- Verify placeholder sets match between English and every translated value.
- Run
git diff --check.
For locale-only JSON changes, the full app typecheck and Jest suite can be skipped if no TypeScript or import graph changed; state that explicitly in the handoff.
1---2name: rabby-i18n-translation3description: When updating `_raw/locales` translation files in the Rabby repository, backfill only non-skipped English leaf keys that are missing or empty in other locales, preserve placeholders, and respect `__skip_translation` markers.4---56# Rabby I18n Translation78Use this playbook when editing locale JSON files under:910- `_raw/locales/*/messages.json`1112When adding or removing a supported language, also update:1314- `_raw/locales/index.json`1516The browser extension manifest locale files under `_raw/_locales/*/messages.json` use Chrome `message`/`description` objects. Edit them only when the task explicitly targets extension manifest metadata, and preserve that object shape.1718## Scope1920Backfill only leaf string keys where English has a non-empty value and the target locale either:2122- does not have the key23- has the key with an empty string value2425Do not rewrite existing non-empty translations during a missing-key backfill.2627## Skip Rules2829Always evaluate `__skip_translation` before deciding what is missing.30311. `__skip_translation: true`3233 The entire object is excluded from translation. Do not add, translate, or count any descendant leaf key in that object.34352. `__skip_translation: ["keyA", "keyB"]`3637 The listed direct child keys are excluded from translation. Do not add, translate, or count those keys, including their descendants if a listed key is an object.38393. The `__skip_translation` marker itself is metadata.4041 Do not translate it, copy it into other locale files, or count it as a missing user-facing key.4243## Quality Rules4445- Preserve interpolation placeholders exactly, such as `{{market}}`, `{{count}}`, and numbered placeholders.46- Preserve React-i18next tags exactly, such as `<1>...</1>` and named tags such as `<bold>...</bold>`.47- Keep product names and protocol terms stable unless the locale already has a consistent localized form.48- Keep common crypto abbreviations such as `APY`, `TVL`, `LTV`, `DeFi`, `DEX`, `NFT`, `RWA`, `TP`, `SL`, and `LIQ` untranslated when they are intentionally marked as skipped or used as industry labels.49- Match the surrounding locale's tone and terminology before adding new translations.5051## Validation5253After edits:54551. Parse every `_raw/locales/*/messages.json` file with `JSON.parse`.562. Compare every non-skipped English leaf string against each target locale and verify no non-skipped key is missing or empty.573. Verify placeholder sets match between English and every translated value.584. Run `git diff --check`.5960For locale-only JSON changes, the full app typecheck and Jest suite can be skipped if no TypeScript or import graph changed; state that explicitly in the handoff.