i18n-sync
Use this skill when you need to keep i18n keys in sync across frontend, backend, iOS, and Android.
Contract
- Function pattern:
i18n("key", { count: 0, name: userName }) - Function name is fixed to
i18n - Second argument must be an object/map literal
- Translation storage is always flat JSON:
{ "key": "value with {param}" } - API auth token is not required; fetch by
projectKey
Commands
i18n-sync extracti18n-sync validatei18n-sync sync- Optional overrides:
--project-key <key>,--url <api-url>
Required setup
Before running commands, create this file in the execution directory:
./i18n.config.json
Required fields:
api.urlapi.requestBody.projectKey
If ./i18n.config.json does not exist, the CLI exits and prompts user to create it.
What it does
- Extract keys and params from source code.
- Pull all project translation JSON from API once.
- Filter translations by extracted keys.
- Validate placeholders (translation side vs code side).
- Emit locale JSON into
<dir>/i18n/.
Default backend endpoint in this repository: POST /api/i18n/translations.
Artifacts
.i18n-artifacts/report.json- Optional (disabled by default):
.i18n-artifacts/keys.json