diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-06-20 11:13:23 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-06-20 11:13:23 -0400 |
commit | b32cad4046916344665c67923482db09cacb366f (patch) | |
tree | 4275d07f180d6d586e2ce2464d0f4ac8514e8746 /src/SMAPI.Web | |
parent | 067163da02c5a5993d88d80f04d379c22bc32cba (diff) | |
download | SMAPI-b32cad4046916344665c67923482db09cacb366f.tar.gz SMAPI-b32cad4046916344665c67923482db09cacb366f.tar.bz2 SMAPI-b32cad4046916344665c67923482db09cacb366f.zip |
add i18n schema to JSON validator
Diffstat (limited to 'src/SMAPI.Web')
-rw-r--r-- | src/SMAPI.Web/Controllers/JsonValidatorController.cs | 3 | ||||
-rw-r--r-- | src/SMAPI.Web/wwwroot/schemas/i18n.json | 24 |
2 files changed, 26 insertions, 1 deletions
diff --git a/src/SMAPI.Web/Controllers/JsonValidatorController.cs b/src/SMAPI.Web/Controllers/JsonValidatorController.cs index c43fb929..8fb9e06a 100644 --- a/src/SMAPI.Web/Controllers/JsonValidatorController.cs +++ b/src/SMAPI.Web/Controllers/JsonValidatorController.cs @@ -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" }; diff --git a/src/SMAPI.Web/wwwroot/schemas/i18n.json b/src/SMAPI.Web/wwwroot/schemas/i18n.json new file mode 100644 index 00000000..493ad213 --- /dev/null +++ b/src/SMAPI.Web/wwwroot/schemas/i18n.json @@ -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." + } + } +} |