Skip to content

Commit 2dcfa09

Browse files
ericyangpanclaude
andcommitted
refactor(schema): rename i18n field to translations
- Rename i18n.schema.json to translations.schema.json - Update entity and collections schemas to use 'translations' field - Update schema documentation to reflect new naming 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 16bde08 commit 2dcfa09

File tree

5 files changed

+25
-25
lines changed

5 files changed

+25
-25
lines changed

docs/SCHEMA-ARCHITECTURE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ collections.schema.json (Independent)
6262
- `id` (string, pattern: `^[a-z0-9-]+$`): Unique identifier
6363
- `name` (string): Official name
6464
- `description` (string, maxLength: 200): Concise description
65-
- `i18n` (object, → i18n.schema.json): Translations
65+
- `translations` (object, → translations.schema.json): Translations
6666
- `websiteUrl` (string, uri, https): Official website
6767
- `docsUrl` (string/null, uri, https): Documentation URL
6868
- `verified` (boolean): Verification status
@@ -231,15 +231,15 @@ collections.schema.json (Independent)
231231

232232
**Structure**:
233233
- `specifications`, `articles`, `tools` (collectionSection)
234-
- `title`, `description`, `i18n` (→ i18n.schema.json), `cards`
235-
- Cards contain: `title`, `i18n`, `items`
236-
- Items contain: `name`, `url`, `description`, `i18n`
234+
- `title`, `description`, `translations` (→ translations.schema.json), `cards`
235+
- Cards contain: `title`, `translations`, `items`
236+
- Items contain: `name`, `url`, `description`, `translations`
237237

238238
---
239239

240240
## Supporting Schemas (ref/)
241241

242-
### i18n.schema.json
242+
### translations.schema.json
243243
**Purpose**: Internationalization translations
244244

245245
**Pattern**: `^[a-z]{2}(-[A-Z][a-z]+)?$` (e.g., `zh-Hans`, `en`)

docs/SCHEMA-REFACTORING-SUMMARY.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ This document summarizes the schema refactoring work done to improve the design
88

99
### 1. Fixed i18n Schema Duplication ✅
1010

11-
**Problem**: `collections.schema.json` was redefining its own i18n structure instead of reusing the standard `i18n.schema.json`.
11+
**Problem**: `collections.schema.json` was redefining its own translations structure instead of reusing the standard `translations.schema.json`.
1212

1313
**Solution**:
14-
- Made `i18n.schema.json` more flexible by removing the `required` constraint on `description`
15-
- Updated `collections.schema.json` to reference `./ref/i18n.schema.json` instead of inline definitions
14+
- Made `translations.schema.json` more flexible by removing the `required` constraint on `description`
15+
- Updated `collections.schema.json` to reference `./ref/translations.schema.json` instead of inline definitions
1616
- Both `collectionCard` and `collectionItem` now use the standard i18n schema
1717

1818
### 2. Resolved pricing Field Semantic Conflict ✅
@@ -130,7 +130,7 @@ All manifest files now pass validation:
130130
- `manifests/$schemas/ref/vendor-entity.schema.json` (NEW)
131131
- `manifests/$schemas/ref/product.schema.json`
132132
- `manifests/$schemas/ref/app.schema.json`
133-
- `manifests/$schemas/ref/i18n.schema.json`
133+
- `manifests/$schemas/ref/translations.schema.json`
134134
- `manifests/$schemas/clis.schema.json`
135135
- `manifests/$schemas/ides.schema.json`
136136
- `manifests/$schemas/models.schema.json`

manifests/$schemas/collections.schema.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"$defs": {
2121
"collectionSection": {
2222
"type": "object",
23-
"description": "A collection section containing title, description, i18n, and cards",
23+
"description": "A collection section containing title, description, translations, and cards",
2424
"properties": {
2525
"title": {
2626
"type": "string",
@@ -30,8 +30,8 @@
3030
"type": "string",
3131
"description": "Section description"
3232
},
33-
"i18n": {
34-
"$ref": "./ref/i18n.schema.json",
33+
"translations": {
34+
"$ref": "./ref/translations.schema.json",
3535
"description": "Internationalization translations for section fields"
3636
},
3737
"cards": {
@@ -43,19 +43,19 @@
4343
"minItems": 1
4444
}
4545
},
46-
"required": ["title", "description", "i18n", "cards"],
46+
"required": ["title", "description", "translations", "cards"],
4747
"additionalProperties": false
4848
},
4949
"collectionCard": {
5050
"type": "object",
51-
"description": "A card containing a title, i18n, and items",
51+
"description": "A card containing a title, translations, and items",
5252
"properties": {
5353
"title": {
5454
"type": "string",
5555
"description": "Card title"
5656
},
57-
"i18n": {
58-
"$ref": "./ref/i18n.schema.json",
57+
"translations": {
58+
"$ref": "./ref/translations.schema.json",
5959
"description": "Internationalization translations for card fields"
6060
},
6161
"items": {
@@ -67,7 +67,7 @@
6767
"minItems": 0
6868
}
6969
},
70-
"required": ["title", "i18n", "items"],
70+
"required": ["title", "translations", "items"],
7171
"additionalProperties": false
7272
},
7373
"collectionItem": {
@@ -88,12 +88,12 @@
8888
"type": "string",
8989
"description": "Item description"
9090
},
91-
"i18n": {
92-
"$ref": "./ref/i18n.schema.json",
91+
"translations": {
92+
"$ref": "./ref/translations.schema.json",
9393
"description": "Internationalization translations for item fields"
9494
}
9595
},
96-
"required": ["name", "url", "description", "i18n"],
96+
"required": ["name", "url", "description", "translations"],
9797
"additionalProperties": false
9898
}
9999
}

manifests/$schemas/ref/entity.schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
"description": "A concise description of the entity and its key features, summarized from the official website homepage, company page, or about page",
2020
"maxLength": 200
2121
},
22-
"i18n": {
23-
"$ref": "./i18n.schema.json",
22+
"translations": {
23+
"$ref": "./translations.schema.json",
2424
"description": "Internationalization translations"
2525
},
2626
"verified": {
@@ -34,5 +34,5 @@
3434
"description": "Official website URL"
3535
}
3636
},
37-
"required": ["id", "name", "description", "i18n", "verified", "websiteUrl"]
37+
"required": ["id", "name", "description", "translations", "verified", "websiteUrl"]
3838
}

manifests/$schemas/ref/i18n.schema.json renamed to manifests/$schemas/ref/translations.schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "i18n.schema.json",
4-
"title": "I18n Schema",
3+
"$id": "translations.schema.json",
4+
"title": "Translations Schema",
55
"description": "Internationalization translations schema for use across all manifests",
66
"type": "object",
77
"patternProperties": {

0 commit comments

Comments
 (0)