Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Internationalization (i18n) workflow and standards for managing translations. Use when: (1) Adding new user-facing text, (2) Creating new components with user-facing text, (3) Reviewing code for i18n compliance, (4) Adding a new translation module.
.claude/skills/iofficeai-i18n/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 75% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 87% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 93% | 0% |
| case-20 | ✓→✗ | ▼ Worse | 51% | 0% |
Standards and workflow for internationalization. All user-visible text must use i18n.
Announce at start: "I'm using i18n skill to ensure proper internationalization."
Before doing any i18n work, always read src/common/config/i18n-config.json to get the current list of supported languages and modules. Never assume a fixed number — languages and modules may have been added or removed since this skill was written.
bashcat src/common/config/i18n-config.json
This file is the single source of truth. All scripts, runtime code, and this workflow depend on it.
src/common/config/i18n-config.json # Single source of truth: languages, modules
src/renderer/i18n/
├── index.ts # i18next configuration
├── i18n-keys.d.ts # AUTO-GENERATED — do not edit manually
└── locales/
├── <lang>/ # One directory per language in i18n-config.json
│ ├── index.ts # Barrel import for all modules
│ ├── common.json # One JSON per module in i18n-config.json
│ ├── conversation.json
│ └── ...
└── ...referenceLanguage in i18n-config.json (currently en-US)supportedLanguages array — read the file to get the current listmodules array — read the file to get the current listKeys use namespaced dot notation in code: t('module.key') or t('module.nested.key').
Inside each module JSON file, keys can be flat or nested:
json// common.json — flat keys { "send": "Send", "cancel": "Cancel", "copySuccess": "Copied" } // cron.json — nested keys { "scheduledTasks": "Scheduled Tasks", "status": { "active": "Active", "paused": "Paused" } }
In code:
typescriptt('common.send'); // flat key in common.json t('cron.status.active'); // nested key in cron.json
copySuccess, scheduledTasksstatus.active, actions.pausecommon.json: save, cancel, delete, confirm, etc.| Suffix | Usage | | ------------------- | -------------------- | | title | Section/page titles | | placeholder | Input placeholders | | label | Form labels | | success / error | Status messages | | confirm | Confirmation dialogs | | empty | Empty state messages | | tooltip | Tooltip text |
src/common/config/i18n-config.jsonGet the current language list and module list. Do not skip this step.
Before adding a new key, search for similar existing keys:
bashgrep -r "keyword" src/renderer/i18n/locales/en-US/
Reuse common.* keys when possible.
Match the module to the feature area. If no module fits, consider whether a new module is needed (see "Adding a New Module" below).
CRITICAL: Every new key must be added to every locale in supportedLanguages. Use this checklist for each key:
en-US/<module>.json — reference language (added in Step 3)zh-CN/<module>.json — addedzh-TW/<module>.json — addedsrc/common/config/i18n-config.json → supportedLanguages — addedA key missing from even one locale will cause node scripts/check-i18n.js to fail in CI.
tsximport { useTranslation } from 'react-i18next'; function MyComponent() { const { t } = useTranslation(); return <button>{t('common.save')}</button>; }
Run these two commands in order — both must pass before committing:
bashbun run i18n:types # Step A: regenerate i18n-keys.d.ts from reference locale node scripts/check-i18n.js # Step B: validate structure, keys, and type sync
i18n:types must be run before check-i18n.js — the check validates the generated filecheck-i18n.js exits with errors (❌), fix them before proceedingcheck-i18n.js exits with warnings only (⚠️), review but may proceedi18n-keys.d.tssrc/common/config/i18n-config.json → modules array<module>.json in every locale directory (read supportedLanguages to know which)index.tsbun run i18n:types to regenerate type definitionsnode scripts/check-i18n.js to validateNever use hardcoded Chinese/English text in JSX:
tsx// Bad <span>重命名</span> <span>Delete</span> {name || '新对话'} // Good <span>{t('common.rename')}</span> <span>{t('common.delete')}</span> {name || t('conversation.newConversation')}
console.log() / debug outputjson{ "taskCount": "{{count}} task(s)", "greeting": "Hello, {{name}}!" }
tsxt('cron.taskCount', { count: 5 });
Use Trans component for complex markup:
tsximport { Trans } from 'react-i18next'; <Trans i18nKey='cron.countdown'> Task <strong>{{ taskName }}</strong> in <span>{{ countdown }}</span> </Trans>;
Most terms can be auto-converted from zh-CN, but some need manual review:
| zh-CN | zh-TW | Notes | | ----- | ----- | -------------- | | 视频 | 影片 | Different term | | 软件 | 軟體 | Different term | | 信息 | 訊息 | Different term | | 默认 | 預設 | Different term |
Before submitting code with new text:
src/common/config/i18n-config.json to get current languages and modulest() functionsupportedLanguagesbun run i18n:types ran first (regenerates i18n-keys.d.ts)node scripts/check-i18n.js passed after types regenerated (no errors)| Mistake | Correct | | ---------------------------------------------- | ---------------------------------------------------- | | Assuming a fixed number of languages | Always read i18n-config.json first | | Adding key to only some locales | Add to every locale in supportedLanguages | | Editing i18n-keys.d.ts manually | Run bun run i18n:types to generate | | Using t("New Chat") | Define key: t("conversation.newChat") | | Not updating i18n-config.json for new module | Update config first, then create files | | Adding module JSON but not updating index.ts | Must add import + export in each locale's index.ts |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 5,749 | 3,541 | -38% | 1 | 1 | 0% | 1,173 | 2,622 | +124% | 0 | 0 | — |
case-02 | fail→fail | 74,083 | 2,122 | -97% | 1 | 1 | 0% | 2,793 | 2,352 | -16% | 0 | 0 | — |
case-03 | fail→fail | 3,947 | 2,603 | -34% | 1 | 1 | 0% | 203 | 2,342 | +1054% | 0 | 0 | — |
case-04 | fail→pass | 10,950 | 5,987 | -45% | 1 | 1 | 0% | 1,796 | 3,144 | +75% | 0 | 0 | — |
case-05 | fail→pass | 7,636 | 3,589 | -53% | 1 | 1 | 0% | 1,450 | 2,705 | +87% | 0 | 0 | — |
case-06 | fail→fail | 13,017 | 5,246 | -60% | 1 | 1 | 0% | 2,251 | 3,054 | +36% | 0 | 0 | — |
case-07 | pass→pass | 9,734 | 5,724 | -41% | 1 | 1 | 0% | 1,833 | 3,127 | +71% | 0 | 0 | — |
case-08 | pass→pass | 8,654 | 4,359 | -50% | 1 | 1 | 0% | 1,503 | 2,917 | +94% | 0 | 0 | — |
case-14 | pass→pass | 12,917 | 5,512 | -57% | 1 | 1 | 0% | 2,281 | 3,144 | +38% | 0 | 0 | — |
case-09 | pass→pass | 9,815 | 2,759 | -72% | 1 | 1 | 0% | 1,811 | 2,653 | +46% | 0 | 0 | — |
case-10 | fail→pass | 10,168 | 3,804 | -63% | 1 | 1 | 0% | 1,670 | 2,896 | +73% | 0 | 0 | — |
case-11 | pass→pass | 54,733 | 3,886 | -93% | 1 | 1 | 0% | 1,667 | 2,788 | +67% | 0 | 0 | — |
case-12 | pass→pass | 10,234 | 6,396 | -38% | 1 | 1 | 0% | 1,813 | 3,205 | +77% | 0 | 0 | — |
case-13 | pass→pass | 37,785 | 6,738 | -82% | 1 | 1 | 0% | 2,119 | 3,336 | +57% | 0 | 0 | — |
case-15 | pass→pass | 7,245 | 1,721 | -76% | 1 | 1 | 0% | 1,293 | 2,472 | +91% | 0 | 0 | — |
case-16 | pass→pass | 10,542 | 4,968 | -53% | 1 | 1 | 0% | 1,933 | 3,045 | +58% | 0 | 0 | — |
case-17 | fail→pass | 7,471 | 2,516 | -66% | 1 | 1 | 0% | 1,229 | 2,377 | +93% | 0 | 0 | — |
case-18 | pass→pass | 31,424 | 3,834 | -88% | 1 | 1 | 0% | 1,784 | 2,751 | +54% | 0 | 0 | — |
case-19 | pass→pass | 8,699 | 2,965 | -66% | 1 | 1 | 0% | 1,444 | 2,631 | +82% | 0 | 0 | — |
case-20 | pass→fail | 17,747 | 14,393 | -19% | 1 | 1 | 0% | 3,366 | 5,095 | +51% | 0 | 0 | — |
case-21 | pass→pass | 15,312 | 11,025 | -28% | 1 | 1 | 0% | 2,790 | 4,196 | +50% | 0 | 0 | — |
case-22 | pass→pass | 10,532 | 6,093 | -42% | 1 | 1 | 0% | 1,875 | 3,263 | +74% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +14 percentage points is the difference between those two pass rates over the 21 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.