From 6b2ea0ed812d23309fb99c1ccc4ef65b0fb05810 Mon Sep 17 00:00:00 2001 From: Johan Nyman Date: Mon, 16 Dec 2024 14:40:17 +0100 Subject: [PATCH] localized properties --- .../json-schema/graphics-manifest/schema.json | 10 ++++++++++ .../definition/json-schema/lib/action.json | 10 ++++++++++ .../json-schema/lib/localizable-value.json | 20 +++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 definition/definition/json-schema/lib/localizable-value.json diff --git a/definition/definition/json-schema/graphics-manifest/schema.json b/definition/definition/json-schema/graphics-manifest/schema.json index eddda34..9244765 100644 --- a/definition/definition/json-schema/graphics-manifest/schema.json +++ b/definition/definition/json-schema/graphics-manifest/schema.json @@ -20,10 +20,20 @@ "type": "string", "description": "Name of the Graphic" }, + "name-localized": { + "type": "object", + "description": "Localized version of the \"name\" property. If nothing is provided, the \"name\" property is used instead.", + "$ref": "https://superflytv.github.io/tmp-GraphicsDefinition/definition/definition/json-schema/lib/localizable-value.json" + }, "description": { "type": "string", "description": "(optional) A longer description of the Graphic" }, + "description-localized": { + "type": "object", + "description": "Localized version of the \"description\" property. If nothing is provided, the \"description\" property is used instead.", + "$ref": "https://superflytv.github.io/tmp-GraphicsDefinition/definition/definition/json-schema/lib/localizable-value.json" + }, "author": { "type": "object", "description": "(optional) About the author", diff --git a/definition/definition/json-schema/lib/action.json b/definition/definition/json-schema/lib/action.json index 856b4d6..0b4da3a 100644 --- a/definition/definition/json-schema/lib/action.json +++ b/definition/definition/json-schema/lib/action.json @@ -7,10 +7,20 @@ "type": "string", "description": "The name of the action. This is displayed to the user." }, + "label-localized": { + "type": "object", + "description": "Localized version of the \"label\" property. If nothing is provided, the \"label\" property is used instead.", + "$ref": "https://superflytv.github.io/tmp-GraphicsDefinition/definition/definition/json-schema/lib/localizable-value.json" + }, "description": { "type": "string", "description": "A longer description of the action. This is displayed to the user." }, + "description-localized": { + "type": "object", + "description": "Localized version of the \"description\" property. If nothing is provided, the \"description\" property is used instead.", + "$ref": "https://superflytv.github.io/tmp-GraphicsDefinition/definition/definition/json-schema/lib/localizable-value.json" + }, "schema": { "description": "The schema of the action. This is used to validate the action parameters as well as auto-generate a GUI for the action.", "oneOf": [ diff --git a/definition/definition/json-schema/lib/localizable-value.json b/definition/definition/json-schema/lib/localizable-value.json new file mode 100644 index 0000000..0260cce --- /dev/null +++ b/definition/definition/json-schema/lib/localizable-value.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "https://superflytv.github.io/tmp-GraphicsDefinition/definition/definition/json-schema/lib/localizable-value.json", + "type": "object", + "comment": "Based on https://www.w3.org/TR/localizable-manifests/#language-maps", + + "patternProperties":{ + ".*": { + "type": "object", + "description": "Language map, example: {\"en\": {\"value\": \"Hello\"}, \"fr\": {\"value\": \"Bonjour\"}}", + "properties": { + "value": { + "type": "string", + "description": "Localizable value" + } + } + } + }, + "additionalProperties": false +}