Handles locale management and translation integration without modifying auto-generated files.

Install

mkdir -p .claude/skills/1k-i18n && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/4196" && unzip -o skill.zip -d .claude/skills/1k-i18n && rm skill.zip

Installs to .claude/skills/1k-i18n

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Internationalization — translations (ETranslations, useIntl, formatMessage) and locale management. NEVER modify auto-generated translation files.
145 charsno explicit “when” trigger
Intermediate

Key capabilities

  • →Manage translation keys using ETranslations
  • →Implement locale-aware components with useIntl
  • →Sync translation files via yarn i18n:pull
  • →Add new translation keys using yarn i18n:add

How it works

The skill utilizes the react-intl library and generated ETranslations enums to map semantic keys to localized strings, ensuring consistency across the application.

Inputs & outputs

You give it
Translation key identifier
You get back
Localized string in the application

When to use 1k-i18n

  • →Adding new translation keys
  • →Implementing useIntl hooks
  • →Configuring locale management

About this skill

OneKey i18n

Use repository scripts for scanning, merging, previews, upload and verification. The model selects scope, judges reuse, writes copy and translates.

Rules

  • Never manually edit generated locale JSON, translations.ts or localeJsonMap.ts.
  • Runtime translations come from bundled locale JSON (localeLoaders.ts), not live Lokalise requests. Remote deletion leaves existing released app bundles unchanged; subsequent pulls and builds receive the deletion.
  • Prefer existing generic keys when meaning, placeholders, capitalization and UI role match. Do not duplicate legacy keys for naming consistency or change shared copy unless explicitly in scope.
  • Translate every locale listed in the draft; preserve ICU placeholders/tags and product tone. Do not use English as a placeholder for untranslated languages.
  • Use compact summaries, local search and relevant source slices; do not load entire locale catalogs. Review dynamic expressions and imported copy the scanner cannot resolve.
ModeMissing key or empty/whitespace translationExisting non-empty translation
complete (default)Create or fillPreserve
updateCreate or fillMay update within the requested scope

Both modes use upsert. Do not silently switch modes to bypass a rejected overwrite.

Workflow

Paths are relative to the repository root; use .tmp/i18n/<task>/ for <dir>. For <wrapper>, use the configured op (default), keychain or oenv. If one wrapper is unavailable, check the other installed/configured wrappers before asking the user to sign in or change credentials; do not configure a new account on their behalf. In Codex, oenv requires approved execution outside the sandbox. A sandbox signature error does not authorize bypassing signature checks or reinstalling the app. Never print credentials. Credential loading and remote sync can be silent for tens of seconds. Poll a running command and allow at least three minutes before diagnosing a timeout; silence alone is not evidence of missing credentials or an authorization dialog. An explicit error or user cancellation can stop the wait earlier. Keep the user informed while waiting, and inspect the process/receipt before retrying a command.

  1. Pull before selecting or translating copy, in both modes: yarn <wrapper> yarn i18n:workflow sync --project-name "Monorepo v5" --out <dir>/sync.json. Verify the returned project name/ID. Preserve unknown local generated changes if the script blocks; use recovery guidance.

  2. Locate the module with rg, then run yarn i18n:workflow scan --mode <mode> --sync <dir>/sync.json --module <path> --out <dir>/draft.json. Repeat --module for related copy. For explicit updates to already complete keys, add --include-complete and limit edits to the requested keys/languages.

  3. Read draft.json.summary.json and relevant code. Search reusable keys with yarn i18n:search. Choose upsert/reuse or ignore (with a reason); fill missing or requested translations using the patch format. Use inspect --file <draft> to check remaining work.

  4. Generate a plan with a new filename: yarn <wrapper> yarn i18n:workflow preview --file <dir>/draft.json --project-name "Monorepo v5" --out <dir>/plan.json. Scripts generate JSON, Markdown and HTML; never write one-off preview HTML.

  5. Paste the generated Markdown into the conversation, provide the HTML link, state mode/change scope, and wait for confirmation. Markdown shows only English and Simplified Chinese, including old → new wording for updates:

    KeyCopy
    key1English text
    中文文案

    If the user returns HTML feedback, follow feedback import. Edits/comments request a revision, not upload approval. Changes to copy, scope, mode or remote baseline require a new preview and confirmation.

  6. After confirmation, run yarn <wrapper> yarn i18n:workflow apply --file <dir>/plan.json --approve <confirmed-hash>. This uploads, pulls and verifies. Check the receipt and full generated diff, including unrelated remote changes; use recovery guidance if interrupted.

  7. Wire generated keys into the requested module, rescan and run appropriate checks. Report project, locale count, upload/pull verification, unrelated generated changes and code wiring. A prepared preview is not a completed upload.

  8. If keys changed, preserve the old → new mapping. After apply, pull verification and code migration succeed, prepare the old-key cleanup list and ask whether to delete it. Translation confirmation does not authorize deletion; keep old keys unless the user explicitly approves that deletion scope.

Code usage

New keys use semantic_key__title, __action, __desc or __msg. Legacy mapping: remote global::contact_us → JSON global.contact_us → enum ETranslations.global_contact_us.

Use useIntl().formatMessage({ id: ETranslations.some_key }) during React rendering, or appLocale.intl at call time outside React. Do not cache translated text in module-level constants; keep memo/callback dependencies responsive to locale changes.

For yarn i18n:add compatibility, see single-key commands.

When not to use it

  • →Do not modify auto-generated translation files directly

Prerequisites

yarn

Limitations

  • →Cannot manually edit auto-generated locale files
  • →Requires Lokalise for source translation updates

How it compares

This approach enforces a strict separation between source translation management in Lokalise and local code usage, preventing manual corruption of generated JSON files.

Compared to similar skills

1k-i18n side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
1k-i18n (this skill)12moNo flagsIntermediate
i18n-expert28moReviewIntermediate
i18n-localization03moReviewIntermediate
localize05moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

You might also like

i18n-expert

daymade

This skill should be used when setting up, auditing, or enforcing internationalization/localization in UI codebases (React/TS, i18next or similar, JSON locales), including installing/configuring the i18n framework, replacing hard-coded strings, ensuring en-US/zh-CN coverage, mapping error codes to localized messages, and validating key parity, pluralization, and formatting.

25

i18n-localization

Harmitx7

Internationalization (i18n) and localization mastery. Abstracting hardcoded strings, managing JSON/YAML translation dictionaries, bidirectional routing (RTL support for Arabic/Hebrew), Pluralization algorithms, date/currency formatting, and SSR locale detection in Next.js/React. Use when preparing a

00

localize

aladicf

Plan, implement, or improve an internationalization and localization strategy for UI content, formatting, and regional adaptation. Use when the user asks to add i18n, localize, translate, support multiple languages, handle regional formats, manage locale switching, or build a multilingual product.

00

sif-intl

navikt

Mønster for typesikker i18n (nb/nn) i apper og pakker — implementering, parametersjekk og meningssjekk.

00

skills

jralvarenga

Package map and reading order for Better Translate product skills.

00

nextjs-developer

zenobi-us

Expert Next.js developer mastering Next.js 14+ with App Router and full-stack features. Specializes in server components, server actions, performance optimization, and production deployment with focus on building fast, SEO-friendly applications.

328531

Search skills

Search the agent skills registry