Skip to content

Commit 2c37dba

Browse files
[docs] Add Claude command for adding missing i18n strings (#4023)
1 parent 3936454 commit 2c37dba

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Add Missing i18n Translations
2+
3+
## Task: Add English translations for all new localized strings
4+
5+
### Step 1: Identify new translation keys
6+
Find all translation keys that were added in the current branch's changes. These keys appear as arguments to translation functions: `t()`, `st()`, `$t()`, or similar i18n functions.
7+
8+
### Step 2: Add translations to English locale file
9+
For each new translation key found, add the corresponding English text to the file `src/locales/en/main.json`.
10+
11+
### Key-to-JSON mapping rules:
12+
- Translation keys use dot notation to represent nested JSON structure
13+
- Convert dot notation to nested JSON objects when adding to the locale file
14+
- Example: The key `g.user.name` maps to:
15+
```json
16+
{
17+
"g": {
18+
"user": {
19+
"name": "User Name"
20+
}
21+
}
22+
}
23+
```
24+
25+
### Important notes:
26+
1. **Only modify the English locale file** (`src/locales/en/main.json`)
27+
2. **Do not modify other locale files** - translations for other languages are automatically generated by the `i18n.yaml` workflow
28+
3. **Exception for manual translations**: Only add translations to non-English locale files if:
29+
- You have specific domain knowledge that would produce a more accurate translation than the automated system
30+
- The automated translation would likely be incorrect due to technical terminology or context-specific meaning
31+
32+
### Example workflow:
33+
1. If you added `t('settings.advanced.enable')` in a Vue component
34+
2. Add to `src/locales/en/main.json`:
35+
```json
36+
{
37+
"settings": {
38+
"advanced": {
39+
"enable": "Enable advanced settings"
40+
}
41+
}
42+
}
43+
```

0 commit comments

Comments
 (0)