Skip to content

Commit b32cad4

Browse files
committed
add i18n schema to JSON validator
1 parent 067163d commit b32cad4

File tree

4 files changed

+30
-3
lines changed

4 files changed

+30
-3
lines changed

docs/release-notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
* For the web UI:
2222
* Added GitHub licenses to mod compatibility list.
23+
* Added SMAPI `i18n` schema to JSON validator.
2324
* Updated ModDrop URLs.
2425
* Internal changes to improve performance and reliability.
2526

docs/technical/web.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ Available schemas:
110110

111111
format | schema URL
112112
------ | ----------
113-
[SMAPI `manifest.json`](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest) | https://smapi.io/schemas/manifest.json
114-
[Content Patcher `content.json`](https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme) | https://smapi.io/schemas/content-patcher.json
113+
[SMAPI: `manifest.json`](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest) | https://smapi.io/schemas/manifest.json
114+
[SMAPI: translations (`i18n` folder)](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Translation) | https://smapi.io/schemas/i18n.json
115+
[Content Patcher: `content.json`](https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme) | https://smapi.io/schemas/content-patcher.json
115116

116117
## Web API
117118
### Overview

src/SMAPI.Web/Controllers/JsonValidatorController.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ internal class JsonValidatorController : Controller
2727
private readonly IDictionary<string, string> SchemaFormats = new Dictionary<string, string>
2828
{
2929
["none"] = "None",
30-
["manifest"] = "Manifest",
30+
["manifest"] = "SMAPI: manifest",
31+
["i18n"] = "SMAPI: translations (i18n)",
3132
["content-patcher"] = "Content Patcher"
3233
};
3334

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://smapi.io/schemas/i18n.json",
4+
"title": "SMAPI i18n file",
5+
"description": "A translation file for a SMAPI mod or content pack.",
6+
"@documentationUrl": "https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Translation",
7+
"type": "object",
8+
9+
"properties": {
10+
"$schema": {
11+
"title": "Schema",
12+
"description": "A reference to this JSON schema. Not part of the actual format, but useful for validation tools.",
13+
"type": "string",
14+
"const": "https://smapi.io/schemas/manifest.json"
15+
}
16+
},
17+
18+
"additionalProperties": {
19+
"type": "string",
20+
"@errorMessages": {
21+
"type": "Invalid property. Translation files can only contain text property values."
22+
}
23+
}
24+
}

0 commit comments

Comments
 (0)