Skip to content

Commit 1e1b158

Browse files
ericyangpanclaude
andcommitted
docs: update project configuration and documentation
- CLAUDE.md: Update project guidelines and i18n instructions - cspell.json: Add new terms to spelling dictionary - data/github-stars.json: Update GitHub stats data - docs/MANIFEST_I18N.md: Update manifest i18n documentation Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d72bfb7 commit 1e1b158

File tree

4 files changed

+35
-4
lines changed

4 files changed

+35
-4
lines changed

CLAUDE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,35 @@ When creating or modifying any page, module, or data:
2828
- **DRY principle for translations:** Before creating new translation keys, search existing translation modules thoroughly to reuse existing terms and phrases
2929
- **Consistency:** Use the same translation keys across similar contexts
3030

31+
### Translation File Organization
32+
33+
Follow the detailed architecture rules in [docs/I18N-ARCHITECTURE-RULES.md](docs/I18N-ARCHITECTURE-RULES.md) for organizing translation resources.
34+
35+
**Core Principles:**
36+
1. **Page translations**: Each page or page group should have its own JSON file (e.g., `ides.json`, `ide-detail.json`)
37+
2. **Component translations**: Organize by component directory:
38+
- `components/common.json` - Root-level components (Header, Footer, etc.)
39+
- `components/navigation.json` - All navigation/* components
40+
- `components/controls.json` - All controls/* components
41+
- `components/sidebar.json` - All sidebar/* components
42+
- `components/product.json` - All product/* components
43+
3. **Minimize `@:` references**: Use `tPage + tShared` or `tComponent + tShared` patterns in code instead of cross-namespace references in JSON
44+
4. **Metadata placement**: Co-locate page metadata (title, description, etc.) with page translations under a `meta` object
45+
5. **Multi-language workflow**: New translation keys should initially use English placeholders across all locales, with proper translation in a separate batch step
46+
47+
**Usage Pattern:**
48+
```tsx
49+
// Pages
50+
const tPage = useTranslations('pages.modelDetail')
51+
const tShared = useTranslations('shared')
52+
53+
// Components (root-level)
54+
const tComponent = useTranslations('components.common.header')
55+
56+
// Components (subdirectories)
57+
const tComponent = useTranslations('components.navigation.breadcrumb')
58+
```
59+
3160
## Design System
3261

3362
**Global Design Principles:**

cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"Kiro",
9999
"Kode",
100100
"komutlari",
101+
"kullaniminda",
101102
"Kuik",
102103
"MMMU",
103104
"Maks",

data/github-stars.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
},
5656
"models": {
5757
"composer": null,
58+
"deepseek-3-2": null,
5859
"glm-4-6v": null
5960
}
6061
}

docs/MANIFEST_I18N.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ translations/
6666
import { useTranslations } from 'next-intl'
6767

6868
export default function MyComponent() {
69-
const t = useTranslations('shared')
70-
return <h1>{t('welcome')}</h1>
69+
const tComponent = useTranslations('shared')
70+
return <h1>{tComponent('welcome')}</h1>
7171
}
7272
```
7373

@@ -305,8 +305,8 @@ import Link from 'next/link'
305305

306306
```typescript
307307
// ✅ Correct
308-
const t = useTranslations('shared')
309-
return <button>{t('submit')}</button>
308+
const tShared = useTranslations('shared')
309+
return <button>{tShared('submit')}</button>
310310

311311
// ❌ Incorrect
312312
return <button>Submit</button>

0 commit comments

Comments
 (0)