You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(skill/i18n): improve workflow documentation and scripts
Enhanced documentation and refactored sync/translate scripts for better clarity and maintainability.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
@@ -5,31 +5,57 @@ description: Internationalization management tool for syncing and translating la
5
5
6
6
# I18n Management Skill
7
7
8
-
Manage multilingual content in the `locales/` directory. This skill provides tools to synchronize language files with the English reference and assist with translations.
8
+
Manage multilingual content in the `translations/` directory. This skill provides tools to synchronize language files with the English reference and assist with translations.
9
9
10
10
## Overview
11
11
12
-
This project uses `next-intl` for internationalization with JSON message files stored in `locales/`:
12
+
This project uses `next-intl` for internationalization with JSON message files organized in `translations/`:
13
13
14
-
-`locales/en.json` - English (source of truth)
15
-
-`locales/zh-Hans.json` - Simplified Chinese
16
-
- Additional language files can be added
14
+
```
15
+
translations/
16
+
├── en/ # English (source of truth)
17
+
│ ├── index.ts # Main export file
18
+
│ ├── shared.json
19
+
│ ├── components.json
20
+
│ └── pages/
21
+
│ ├── home.json
22
+
│ ├── manifesto.json
23
+
│ ├── docs.json
24
+
│ ├── articles.json
25
+
│ ├── curated-collections.json
26
+
│ ├── stacks.json
27
+
│ └── comparison.json
28
+
├── de/ # German
29
+
├── zh-Hans/ # Simplified Chinese
30
+
└── ko/ # Korean
31
+
```
32
+
33
+
**Important:** Each locale must maintain the exact same file structure and JSON key order as `en/`.
34
+
35
+
## Enabled Locales
36
+
37
+
Currently enabled locales in `src/i18n/config.ts`:
38
+
-`en` - English (source of truth)
39
+
-`de` - Deutsch (German)
40
+
-`zh-Hans` - 简体中文 (Simplified Chinese)
41
+
-`ko` - 한국어 (Korean)
17
42
18
-
All language files must maintain the same nested key structure as `en.json`.
43
+
Additional locale directories may exist but are not enabled in the config.
19
44
20
45
## Subcommands
21
46
22
47
### `sync`
23
48
24
-
Synchronize all language files with `en.json` as the source of truth.
49
+
Synchronize all enabled locale directories with `en/` as the source of truth.
25
50
26
51
**What it does:**
27
52
28
-
- Scans all `.json` files in `locales/`directory
29
-
- Compares each file's keys with `en.json`
53
+
- Scans all locale directories in `translations/`that are enabled in config
54
+
- Compares each JSON file's keys with the corresponding English file
30
55
-**Adds missing keys** with English text as placeholder (needs translation)
31
-
-**Removes extra keys** not present in `en.json`
32
-
- Preserves JSON structure and formatting (2-space indentation)
56
+
-**Removes extra keys** not present in English files
57
+
-**Preserves JSON structure, key order, and formatting** (2-space indentation)
58
+
-**Keeps the `index.ts` file structure** for each locale
0 commit comments