Skip to content

Commit 8c90774

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/nextjs-daed829cc9
2 parents 86799a1 + a020d46 commit 8c90774

File tree

627 files changed

+16468
-14326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

627 files changed

+16468
-14326
lines changed

.claude/commands/commit-all.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

.claude/commands/commit.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.claude/skills/i18n/SKILL.md

Lines changed: 127 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,60 @@ translations/
2424
│ ├── articles.json
2525
│ ├── curated-collections.json
2626
│ ├── stacks.json
27-
│ └── comparison.json
27+
│ ├── comparison.json
28+
│ ├── landscape.json
29+
│ ├── open-source-rank.json
30+
│ └── search.json
2831
├── de/ # German
32+
├── es/ # Spanish
33+
├── fr/ # French
34+
├── id/ # Indonesian
35+
├── ja/ # Japanese
36+
├── ko/ # Korean
37+
├── pt/ # Portuguese
38+
├── ru/ # Russian
39+
├── tr/ # Turkish
2940
├── zh-Hans/ # Simplified Chinese
30-
└── ko/ # Korean
41+
└── zh-Hant/ # Traditional Chinese
3142
```
3243

3344
**Important:** Each locale must maintain the exact same file structure and JSON key order as `en/`.
3445

46+
## I18n Architecture
47+
48+
The project has **two separate internationalization systems** that share the same 12 locale configuration:
49+
50+
### 1. UI Translation System (next-intl)
51+
- **Purpose:** Translates static UI strings (buttons, labels, page content, etc.)
52+
- **Location:** `translations/{locale}/*.json`
53+
- **Usage:** Via `useTranslations()` hook or `getTranslations()` server function
54+
- **Managed by:** This skill's sync and translate commands
55+
56+
### 2. Manifest Translation System
57+
- **Purpose:** Translates manifest data (IDEs, CLIs, models, providers, etc.)
58+
- **Location:** `manifests/**/*.json` (in each manifest file's `translations` field)
59+
- **Usage:** Via `localizeManifestItem()` and `localizeManifestItems()` functions
60+
- **Managed by:** Manual editing of manifest files or manifest automation tools
61+
62+
**This skill manages only the UI Translation System.** For manifest translations, edit the manifest JSON files directly or use the manifest-automation skill.
63+
3564
## Enabled Locales
3665

3766
Currently enabled locales in `src/i18n/config.ts`:
3867
- `en` - English (source of truth)
3968
- `de` - Deutsch (German)
40-
- `zh-Hans` - 简体中文 (Simplified Chinese)
69+
- `es` - Español (Spanish)
70+
- `fr` - Français (French)
71+
- `id` - Bahasa Indonesia (Indonesian)
72+
- `ja` - 日本語 (Japanese)
4173
- `ko` - 한국어 (Korean)
74+
- `pt` - Português (Portuguese)
75+
- `ru` - Русский (Russian)
76+
- `tr` - Türkçe (Turkish)
77+
- `zh-Hans` - 简体中文 (Simplified Chinese)
78+
- `zh-Hant` - 繁體中文 (Traditional Chinese)
4279

43-
Additional locale directories may exist but are not enabled in the config.
80+
All 12 locales are fully enabled and must be maintained in sync.
4481

4582
## Subcommands
4683

@@ -117,13 +154,13 @@ Generate translation tasks for Claude Code to translate missing content.
117154
When you need to translate content, use this command in Claude Code:
118155

119156
```
120-
Please run the i18n translate command for zh-Hans
157+
Please run the i18n translate command for ja
121158
```
122159

123160
Claude Code will execute:
124161

125162
```bash
126-
node .claude/skills/i18n/scripts/translate.mjs zh-Hans
163+
node .claude/skills/i18n/scripts/translate.mjs ja
127164
```
128165

129166
**Workflow:**
@@ -145,13 +182,13 @@ node .claude/skills/i18n/scripts/translate.mjs zh-Hans
145182
**Output Example:**
146183

147184
```
148-
🌐 Translation Assistant for zh-Hans
185+
🌐 Translation Assistant for ja
149186
150187
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
151188
📝 Translation Task
152189
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
153190
154-
Target Language: 简体中文 (Simplified Chinese)
191+
Target Language: 日本語 (Japanese)
155192
Entries to translate: 15
156193
157194
Files affected:
@@ -168,13 +205,15 @@ Files affected:
168205
169206
Content to translate:
170207
208+
```json
171209
{
172210
"components.languageSwitcher.english": "English",
173211
"pages.home.hero.title": "Welcome to AI Coding Stack",
174212
"shared.navigation.docs": "Documentation",
175213
...
176214
}
177215
```
216+
```
178217
179218
---
180219
@@ -205,7 +244,16 @@ Each locale has:
205244
// translations/en/index.ts
206245
import components from './components.json'
207246
import articles from './pages/articles.json'
208-
// ... other imports
247+
import comparison from './pages/comparison.json'
248+
import curatedCollections from './pages/curated-collections.json'
249+
import docs from './pages/docs.json'
250+
import home from './pages/home.json'
251+
import landscape from './pages/landscape.json'
252+
import manifesto from './pages/manifesto.json'
253+
import openSourceRank from './pages/open-source-rank.json'
254+
import search from './pages/search.json'
255+
import stacks from './pages/stacks.json'
256+
import shared from './shared.json'
209257
210258
const messages = {
211259
shared,
@@ -216,8 +264,11 @@ const messages = {
216264
docs,
217265
articles,
218266
curatedCollections,
219-
...stacks,
267+
stacks,
220268
comparison,
269+
landscape,
270+
openSourceRank,
271+
search,
221272
},
222273
}
223274
@@ -244,45 +295,59 @@ Becomes: `pages.home.hero.title = "Welcome"`
244295

245296
### Adding a New Language
246297

298+
**Note:** The project currently supports 12 locales. To add a new locale (e.g., Italian 'it'):
299+
247300
1. Add the locale to `src/i18n/config.ts`:
248301

249302
```typescript
250-
export const locales = ['en', 'de', 'zh-Hans', 'ko', 'ja'] as const; // Add 'ja'
303+
export const locales = [
304+
'en', 'de', 'es', 'fr', 'id', 'ja', 'ko', 'pt', 'ru', 'tr', 'zh-Hans', 'zh-Hant',
305+
'it' // Add new locale
306+
] as const;
251307
```
252308

253309
2. Update locale names:
254310

255311
```typescript
256312
export const localeNames: Record<Locale, string> = {
257-
// ...
258-
ja: '日本語',
313+
// ... existing locales
314+
it: 'Italiano',
259315
}
260316

261317
export const localeToOgLocale: Record<Locale, string> = {
262-
// ...
263-
ja: 'ja_JP',
318+
// ... existing locales
319+
it: 'it_IT',
320+
}
321+
```
322+
323+
3. Add to translate.mjs LOCALE_NAMES (`.claude/skills/i18n/scripts/translate.mjs`):
324+
325+
```javascript
326+
const LOCALE_NAMES = {
327+
// ... existing locales
328+
it: 'Italiano (Italian)',
264329
}
265330
```
266331

267-
3. Create the locale directory structure:
332+
4. Create the locale directory structure:
268333

269334
```bash
270-
mkdir -p translations/ja/pages
271-
cp translations/en/index.ts translations/ja/index.ts
272-
cp translations/en/*.json translations/ja/
273-
cp translations/en/pages/*.json translations/ja/pages/
335+
mkdir -p translations/it/pages
336+
cp translations/en/index.ts translations/it/index.ts
337+
cp translations/en/*.json translations/it/
338+
cp translations/en/pages/*.json translations/it/pages/
274339
```
275340

276-
4. Run sync to ensure structure matches:
341+
5. Run sync to ensure structure matches:
277342

278343
```
279344
Please run the i18n sync command
280345
```
281346

282-
5. Run translate to generate translation tasks:
347+
6. Run translate to generate translation tasks:
283348

284349
```
285-
Please run the i18n translate command for ja
350+
Please run the i18n translate command for it
286351
```
287352

288353
## Best Practices
@@ -329,7 +394,45 @@ const rawMessages = (await import(`../../translations/${locale}/index.ts`)).defa
329394
const messages = resolveReferences(rawMessages)
330395
```
331396

332-
The JSON files are loaded through the index.ts for each locale, and the `resolveReferences` function handles `@:path` reference syntax.
397+
The JSON files are loaded through the index.ts for each locale, and the `resolveReferences` function handles reference syntax.
398+
399+
### Reference Resolution
400+
401+
The project supports **reference syntax** for reusing translations:
402+
403+
**Basic Reference:** `@:path.to.key`
404+
```json
405+
{
406+
"shared": {
407+
"appName": "AI Coding Stack",
408+
"welcome": "Welcome to @:shared.appName"
409+
}
410+
}
411+
// Result: "Welcome to AI Coding Stack"
412+
```
413+
414+
**Reference with Modifiers:** `@.modifier:path.to.key`
415+
416+
Supported modifiers:
417+
- `@.upper:path` - Convert to UPPERCASE
418+
- `@.lower:path` - Convert to lowercase
419+
- `@.capitalize:path` - Capitalize first letter
420+
421+
```json
422+
{
423+
"terms": {
424+
"documentation": "documentation",
425+
"title": "@.capitalize:terms.documentation Guide"
426+
}
427+
}
428+
// Result: "Documentation Guide"
429+
```
430+
431+
**Important:**
432+
- References are resolved at runtime by `src/i18n/lib-core.ts`
433+
- Circular references are detected and will throw an error
434+
- References can be nested (references within references)
435+
- Keep reference syntax intact during translation
333436

334437
## License
335438

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
.DS_Store
2323
*.pem
2424

25+
/tmp
26+
2527
# debug
2628
npm-debug.log*
2729
yarn-debug.log*

CLAUDE.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,21 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
55
## Internationalization (i18n)
66

77
When creating or modifying any page, module, or data:
8-
- **MUST support at least 4 languages:** English, Simplified Chinese (zh-Hans), German (de), and Korean (ko), NEVER hardcode `'en' | 'zh-Hans'`
8+
- **MUST support all configured languages (18 total):**
9+
- English (en)
10+
- German (de)
11+
- Spanish (es)
12+
- French (fr)
13+
- Indonesian (id)
14+
- Japanese (ja)
15+
- Korean (ko)
16+
- Portuguese (pt)
17+
- Russian (ru)
18+
- Turkish (tr)
19+
- Simplified Chinese (zh-Hans)
20+
- Traditional Chinese (zh-Hant)
21+
22+
- **NEVER hardcode** a subset of locales like `'en' | 'zh-Hans'`
923
- **MUST use the localized Link component:** Always import and use `import { Link } from '@/i18n/navigation'` instead of Next.js default Link
1024

1125
### Localization Best Practices
@@ -14,6 +28,35 @@ When creating or modifying any page, module, or data:
1428
- **DRY principle for translations:** Before creating new translation keys, search existing translation modules thoroughly to reuse existing terms and phrases
1529
- **Consistency:** Use the same translation keys across similar contexts
1630

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+
1760
## Design System
1861

1962
**Global Design Principles:**

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
> Your AI Coding Ecosystem Hub - Discover, Compare, Build Faster
1616
17-
[Live Site: https://aicodingstack.io](https://aicodingstack.io) | [Contributing](CONTRIBUTING.md) | [Discussions](https://github.com/aicodingstack/aicodingstack.io/discussions)
17+
Live Site: [https://aicodingstack.io](https://aicodingstack.io) | [Contributing](CONTRIBUTING.md) | [Discussions](https://github.com/aicodingstack/aicodingstack.io/discussions)
1818

1919
AI Coding Stack is a comprehensive directory and community-maintained metadata repository for AI-powered coding tools, models, and platforms.
2020

@@ -28,7 +28,7 @@ AI Coding Stack is a comprehensive directory and community-maintained metadata r
2828
- **Curated Collections**: Hand-picked tool collections for specific use cases
2929
- **Community-Driven**: Open-source metadata maintained by the developer community
3030
- **Always Updated**: Latest version tracking and up-to-date information
31-
- **Multilingual**: Support for English, German, Simplified Chinese, and Korean (more coming soon)
31+
- **Multilingual**: Support for 12 languages including English, German, Simplified & Traditional Chinese, Korean, Spanish, French, Indonesian, Japanese, Portuguese, Russian, and Turkish
3232

3333
## Data Structure
3434

@@ -126,7 +126,7 @@ All manifest files are automatically validated against JSON schemas. Make sure y
126126
- **Styling**: Tailwind CSS 4
127127
- **Internationalization**: next-intl
128128
- **Content**: MDX for documentation
129-
- **Deployment**: Cloudflare Workers
129+
- **Deployment**: Cloudflare Workers (via OpenNext for Cloudflare)
130130

131131
## Contributing
132132

0 commit comments

Comments
 (0)