add i18n schema to JSON validator

This commit is contained in:
Jesse Plamondon-Willard 2020-06-20 11:13:23 -04:00
parent 067163da02
commit b32cad4046
No known key found for this signature in database
GPG Key ID: CF8B1456B3E29F49
4 changed files with 30 additions and 3 deletions

View File

@ -20,6 +20,7 @@
* For the web UI:
* Added GitHub licenses to mod compatibility list.
* Added SMAPI `i18n` schema to JSON validator.
* Updated ModDrop URLs.
* Internal changes to improve performance and reliability.

View File

@ -110,8 +110,9 @@ Available schemas:
format | schema URL
------ | ----------
[SMAPI `manifest.json`](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest) | https://smapi.io/schemas/manifest.json
[Content Patcher `content.json`](https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme) | https://smapi.io/schemas/content-patcher.json
[SMAPI: `manifest.json`](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Manifest) | https://smapi.io/schemas/manifest.json
[SMAPI: translations (`i18n` folder)](https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Translation) | https://smapi.io/schemas/i18n.json
[Content Patcher: `content.json`](https://github.com/Pathoschild/StardewMods/tree/develop/ContentPatcher#readme) | https://smapi.io/schemas/content-patcher.json
## Web API
### Overview

View File

@ -27,7 +27,8 @@ namespace StardewModdingAPI.Web.Controllers
private readonly IDictionary<string, string> SchemaFormats = new Dictionary<string, string>
{
["none"] = "None",
["manifest"] = "Manifest",
["manifest"] = "SMAPI: manifest",
["i18n"] = "SMAPI: translations (i18n)",
["content-patcher"] = "Content Patcher"
};

View File

@ -0,0 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://smapi.io/schemas/i18n.json",
"title": "SMAPI i18n file",
"description": "A translation file for a SMAPI mod or content pack.",
"@documentationUrl": "https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Translation",
"type": "object",
"properties": {
"$schema": {
"title": "Schema",
"description": "A reference to this JSON schema. Not part of the actual format, but useful for validation tools.",
"type": "string",
"const": "https://smapi.io/schemas/manifest.json"
}
},
"additionalProperties": {
"type": "string",
"@errorMessages": {
"type": "Invalid property. Translation files can only contain text property values."
}
}
}