Skip to content

Commit ef5a781

Browse files
committed
docs: enhance i18n pattern with meta file translation guide
- Add meta file localization section to pattern 019 - Include translation rules for navigation metadata - Provide examples for JSON structure preservation - Document proper noun handling in translations
1 parent 596c3cb commit ef5a781

File tree

2 files changed

+89
-2
lines changed

2 files changed

+89
-2
lines changed

.claude/patterns/019-fumadocs-i18n-file-structure.md

Lines changed: 87 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,90 @@ content/docs/
4242
│ ├── meta.ko.json
4343
│ ├── custom-controls.mdx
4444
│ └── custom-controls.ko.mdx
45-
```
45+
```
46+
47+
## Translation Guidelines
48+
49+
### 1. File Conversion Process
50+
- Current Korean docs → rename to `.ko.mdx` files
51+
- Create new English versions as default files (without locale suffix)
52+
- Maintain exact same file structure and organization
53+
54+
### 2. Translation Rules
55+
- **Structure**: Never change document structure, headings hierarchy, or organization
56+
- **Code blocks**: Keep code exactly the same, only translate comments within code
57+
- **Frontmatter**: Translate all frontmatter fields (title, description, etc.)
58+
- **Content**: Translate all markdown content while preserving formatting
59+
60+
### 3. Code Block Translation Example
61+
```typescript
62+
// Korean version (.ko.mdx)
63+
const map = new NaverMap({
64+
center: { lat: 37.5665, lng: 126.9780 }, // 서울 중심좌표
65+
zoom: 15 // 줌 레벨
66+
});
67+
68+
// English version (default .mdx)
69+
const map = new NaverMap({
70+
center: { lat: 37.5665, lng: 126.9780 }, // Seoul center coordinates
71+
zoom: 15 // Zoom level
72+
});
73+
```
74+
75+
### 4. Frontmatter Translation Example
76+
```yaml
77+
# Korean (.ko.mdx)
78+
---
79+
title: 카메라 컨트롤
80+
description: 네이버 맵의 카메라 움직임을 제어하는 방법
81+
---
82+
83+
# English (default .mdx)
84+
---
85+
title: Camera Control
86+
description: How to control Naver Map camera movement
87+
---
88+
```
89+
90+
### 5. Meta File Translation
91+
Meta files must also be localized for navigation menus and section titles:
92+
93+
```json
94+
// English (meta.json)
95+
{
96+
"title": "Documentation",
97+
"icon": "Book",
98+
"pages": [
99+
"---Setup---",
100+
"index",
101+
"installation",
102+
"---Usage---",
103+
"components",
104+
"---Guides---",
105+
"marker-clustering",
106+
"camera-control"
107+
]
108+
}
109+
110+
// Korean (meta.ko.json)
111+
{
112+
"title": "문서",
113+
"icon": "Book",
114+
"pages": [
115+
"---설정---",
116+
"index",
117+
"installation",
118+
"---사용법---",
119+
"components",
120+
"---가이드---",
121+
"marker-clustering",
122+
"camera-control"
123+
]
124+
}
125+
```
126+
127+
**Meta Translation Rules:**
128+
- Translate all text values (titles, section dividers)
129+
- Keep JSON structure, keys, and special formatting unchanged
130+
- Preserve external link formats like `[Icon][Text](URL)`
131+
- Don't translate proper nouns (Android, iOS, Expo)

.claude/settings.local.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"mcp__playwright__init-browser",
1818
"mcp__playwright__get-screenshot",
1919
"mcp__playwright__execute-code",
20-
"Bash(sed:*)"
20+
"Bash(sed:*)",
21+
"Bash(grep:*)"
2122
],
2223
"deny": [],
2324
"ask": []

0 commit comments

Comments
 (0)