Internationalization management tool for syncing and translating language files
Manage multilingual content in the translations/ directory. This skill provides tools to synchronize language files with the English reference and assist with translations.
This project uses next-intl for internationalization with JSON message files organized in translations/:
translations/
├── en/ # English (source of truth)
│ ├── index.ts # Main export file
│ ├── shared.json
│ ├── components.json
│ └── pages/
│ ├── home.json
│ ├── manifesto.json
│ ├── docs.json
│ ├── articles.json
│ ├── curated-collections.json
│ ├── stacks.json
│ ├── comparison.json
│ ├── landscape.json
│ ├── open-source-rank.json
│ └── search.json
├── de/ # German
├── es/ # Spanish
├── fr/ # French
├── id/ # Indonesian
├── ja/ # Japanese
├── ko/ # Korean
├── pt/ # Portuguese
├── ru/ # Russian
├── tr/ # Turkish
├── zh-Hans/ # Simplified Chinese
└── zh-Hant/ # Traditional Chinese
Important: Each locale must maintain the exact same file structure and JSON key order as en/.
The project has two separate internationalization systems that share the same 12 locale configuration:
translations/{locale}/*.jsonuseTranslations() hook or getTranslations() server functionmanifests/**/*.json (in each manifest file's translations field)localizeManifestItem() and localizeManifestItems() functionsThis skill manages only the UI Translation System. For manifest translations, edit the manifest JSON files directly or use the manifest-automation skill.
Currently enabled locales in src/i18n/config.ts:
en - English (source of truth)de - Deutsch (German)es - Español (Spanish)fr - Français (French)id - Bahasa Indonesia (Indonesian)ja - 日本語 (Japanese)ko - 한국어 (Korean)pt - Português (Portuguese)ru - Русский (Russian)tr - Türkçe (Turkish)zh-Hans - 简体中文 (Simplified Chinese)zh-Hant - 繁體中文 (Traditional Chinese)All 12 locales are fully enabled and must be maintained in sync.
syncSynchronize all enabled locale directories with en/ as the source of truth.
What it does:
translations/ that are enabled in configindex.ts file structure for each localeUsage:
When you need to sync language files, use this command in Claude Code:
Please run the i18n sync command
Claude Code will execute:
node .claude/skills/i18n/scripts/sync.mjs
Output Example:
🔄 Syncing translation files with en/...
✓ Synced de/
+ Added 3 keys in components.json
+ Added 5 keys in pages/home.json
- Removed 1 key in shared.json
✓ Synced zh-Hans/
+ Added 8 keys in pages/stacks.json
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Sync complete!
Modified: 2 locales
Added: 16 keys
Removed: 1 key
When to use:
translate <locale>Generate translation tasks for Claude Code to translate missing content.
What it does:
en/ and <locale>/Usage:
When you need to translate content, use this command in Claude Code:
Please run the i18n translate command for ja
Claude Code will execute:
node .claude/skills/i18n/scripts/translate.mjs ja
Workflow:
Translation Guidelines (automatically enforced):
✓ Preserve brand names: AI Coding Stack, Claude Code, etc.
✓ Keep placeholders intact: {count}, {name}, ${variable}
✓ Don't translate URLs: https://example.com
✓ Don't translate file paths: /path/to/file
✓ Maintain terminology consistency throughout the translation
✓ Preserve reference syntax: @:path.to.key for internal references
Output Example:
🌐 Translation Assistant for ja
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📝 Translation Task
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Target Language: 日本語 (Japanese)
Entries to translate: 15
Files affected:
- components.json: 5 entries
- pages/home.json: 8 entries
- shared.json: 2 entries
⚠ Translation Guidelines:
1. Preserve brand names: "AI Coding Stack", "Claude Code"
2. Keep placeholders intact: {count}, {name}, ${variable}
3. Don't translate URLs and file paths
4. Maintain consistent terminology
5. Preserve reference syntax: @:path.to.key
Content to translate:
```json
{
"components.languageSwitcher.english": "English",
"pages.home.hero.title": "Welcome to AI Coding Stack",
"shared.navigation.docs": "Documentation",
...
}
---
## File Structure
.claude/skills/i18n/ ├── SKILL.md # This documentation └── scripts/ ├── sync.mjs # Synchronization script └── translate.mjs # Translation assistant script
## Technical Details
**Language:** Node.js (ES Modules)
**Dependencies:** Built-in Node.js modules only (`fs`, `path`)
**JSON Format:** 2-space indentation, trailing newline
**Encoding:** UTF-8
### Translation File Structure
Each locale has:
1. **JSON files**: Contain the actual message data
2. **index.ts**: Imports and assembles messages
```typescript
// translations/en/index.ts
import components from './components.json'
import articles from './pages/articles.json'
import comparison from './pages/comparison.json'
import curatedCollections from './pages/curated-collections.json'
import docs from './pages/docs.json'
import home from './pages/home.json'
import landscape from './pages/landscape.json'
import manifesto from './pages/manifesto.json'
import openSourceRank from './pages/open-source-rank.json'
import search from './pages/search.json'
import stacks from './pages/stacks.json'
import shared from './shared.json'
const messages = {
shared,
components,
pages: {
home,
manifesto,
docs,
articles,
curatedCollections,
stacks,
comparison,
landscape,
openSourceRank,
search,
},
}
export default messages
The scripts use recursive traversal to handle nested JSON structures. Keys are compared using dot notation:
{
"pages": {
"home": {
"hero": {
"title": "Welcome"
}
}
}
}
Becomes: pages.home.hero.title = "Welcome"
Note: The project currently supports 12 locales. To add a new locale (e.g., Italian 'it'):
src/i18n/config.ts:export const locales = [
'en', 'de', 'es', 'fr', 'id', 'ja', 'ko', 'pt', 'ru', 'tr', 'zh-Hans', 'zh-Hant',
'it' // Add new locale
] as const;
export const localeNames: Record<Locale, string> = {
// ... existing locales
it: 'Italiano',
}
export const localeToOgLocale: Record<Locale, string> = {
// ... existing locales
it: 'it_IT',
}
.claude/skills/i18n/scripts/translate.mjs):const LOCALE_NAMES = {
// ... existing locales
it: 'Italiano (Italian)',
}
mkdir -p translations/it/pages
cp translations/en/index.ts translations/it/index.ts
cp translations/en/*.json translations/it/
cp translations/en/pages/*.json translations/it/pages/
Please run the i18n sync command
Please run the i18n translate command for it
sync before translate to ensure all keys exist@:path.to.key) for reused contentProblem: Script says "directory not found"
translations/ directory existsProblem: Keys are out of sync after adding new content
sync command to update all locale filesProblem: Translation contains placeholders like {0} instead of {count}
Problem: Some text appears in English in the translated app
translate to find missing translations, check for English fallbacksProblem: index.ts imports are wrong after sync
This skill is designed to work with the project's next-intl setup:
// src/i18n/request.ts
const rawMessages = (await import(`../../translations/${locale}/index.ts`)).default
const messages = resolveReferences(rawMessages)
The JSON files are loaded through the index.ts for each locale, and the resolveReferences function handles reference syntax.
The project supports reference syntax for reusing translations:
Basic Reference: @:path.to.key
{
"shared": {
"appName": "AI Coding Stack",
"welcome": "Welcome to @:shared.appName"
}
}
// Result: "Welcome to AI Coding Stack"
Reference with Modifiers: @.modifier:path.to.key
Supported modifiers:
@.upper:path - Convert to UPPERCASE@.lower:path - Convert to lowercase@.capitalize:path - Capitalize first letter{
"terms": {
"documentation": "documentation",
"title": "@.capitalize:terms.documentation Guide"
}
}
// Result: "Documentation Guide"
Important:
src/i18n/lib-core.tsThis skill is part of the AI Coding Stack project and follows the project's Apache 2.0 license.
npx skills add aicodingstack/i18n下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer