What problem does it solve?
Internationalization in React projects can become error-prone and hard to maintain as teams add languages, keys, and translations across locales. This Skill provides a standardized approach to manage i18n keys, namespaces, and translation generation with react-i18next to ensure consistency and reduce manual overhead.
Core Features & Use Cases
- Key Naming & Convention: Enforces flat dot-notation keys (e.g., feature.context.action) to keep translations predictable and scalable.
- Namespace Workflow: Guides adding namespaces under src/locales/default and exporting them in src/locales/default/index.ts for incremental localization.
- Translation Generation: Uses pnpm i18n to generate translations across languages (e.g., zh-CN, en-US) and provides dev-preview translations when needed.
- Usage Patterns: Demonstrates practical usage in React components with useTranslation from react-i18next and multiple namespaces.
Quick Start
Add a new translation key to src/locales/default/{namespace}.ts and run pnpm i18n to refresh all language files.