diff --git a/Docs/Schemas/IconConfigJson.schema.json b/Docs/Schemas/IconConfigJson.schema.json index b88ee7eb5..55a092fc5 100644 --- a/Docs/Schemas/IconConfigJson.schema.json +++ b/Docs/Schemas/IconConfigJson.schema.json @@ -2,7 +2,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/IconConfigJsonJSC.ts b/Docs/Schemas/IconConfigJsonJSC.ts index 27c9d34d1..5350d6336 100644 --- a/Docs/Schemas/IconConfigJsonJSC.ts +++ b/Docs/Schemas/IconConfigJsonJSC.ts @@ -2,7 +2,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/LayerConfigJson.schema.json b/Docs/Schemas/LayerConfigJson.schema.json index 64bf6a0ae..813886e20 100644 --- a/Docs/Schemas/LayerConfigJson.schema.json +++ b/Docs/Schemas/LayerConfigJson.schema.json @@ -588,7 +588,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/LayerConfigJsonJSC.ts b/Docs/Schemas/LayerConfigJsonJSC.ts index ceb3d20d5..081f0b0db 100644 --- a/Docs/Schemas/LayerConfigJsonJSC.ts +++ b/Docs/Schemas/LayerConfigJsonJSC.ts @@ -582,7 +582,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/LayoutConfigJson.schema.json b/Docs/Schemas/LayoutConfigJson.schema.json index 262a08362..86d663ac3 100644 --- a/Docs/Schemas/LayoutConfigJson.schema.json +++ b/Docs/Schemas/LayoutConfigJson.schema.json @@ -479,7 +479,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/LayoutConfigJsonJSC.ts b/Docs/Schemas/LayoutConfigJsonJSC.ts index 85d0e8fb1..0365d9044 100644 --- a/Docs/Schemas/LayoutConfigJsonJSC.ts +++ b/Docs/Schemas/LayoutConfigJsonJSC.ts @@ -473,7 +473,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/LineRenderingConfigJson.schema.json b/Docs/Schemas/LineRenderingConfigJson.schema.json index 43a7dd60e..d7ba3d7a2 100644 --- a/Docs/Schemas/LineRenderingConfigJson.schema.json +++ b/Docs/Schemas/LineRenderingConfigJson.schema.json @@ -260,7 +260,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/LineRenderingConfigJsonJSC.ts b/Docs/Schemas/LineRenderingConfigJsonJSC.ts index dcd069e11..ab350931a 100644 --- a/Docs/Schemas/LineRenderingConfigJsonJSC.ts +++ b/Docs/Schemas/LineRenderingConfigJsonJSC.ts @@ -254,7 +254,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/MappingConfigJson.schema.json b/Docs/Schemas/MappingConfigJson.schema.json index 7c290771d..76009aebe 100644 --- a/Docs/Schemas/MappingConfigJson.schema.json +++ b/Docs/Schemas/MappingConfigJson.schema.json @@ -287,7 +287,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/MappingConfigJsonJSC.ts b/Docs/Schemas/MappingConfigJsonJSC.ts index 6ad32b6df..0c89d99d9 100644 --- a/Docs/Schemas/MappingConfigJsonJSC.ts +++ b/Docs/Schemas/MappingConfigJsonJSC.ts @@ -281,7 +281,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/PointRenderingConfigJson.schema.json b/Docs/Schemas/PointRenderingConfigJson.schema.json index bce458db8..69ed58d52 100644 --- a/Docs/Schemas/PointRenderingConfigJson.schema.json +++ b/Docs/Schemas/PointRenderingConfigJson.schema.json @@ -334,7 +334,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/PointRenderingConfigJsonJSC.ts b/Docs/Schemas/PointRenderingConfigJsonJSC.ts index 204310ef2..5e36aff07 100644 --- a/Docs/Schemas/PointRenderingConfigJsonJSC.ts +++ b/Docs/Schemas/PointRenderingConfigJsonJSC.ts @@ -328,7 +328,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json b/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json index 9a0888618..3a664c5c2 100644 --- a/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json +++ b/Docs/Schemas/QuestionableTagRenderingConfigJson.schema.json @@ -396,7 +396,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts b/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts index 4eb54c3d6..6e3cd82d7 100644 --- a/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts +++ b/Docs/Schemas/QuestionableTagRenderingConfigJsonJSC.ts @@ -390,7 +390,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/RewritableConfigJson.schema.json b/Docs/Schemas/RewritableConfigJson.schema.json index 822013b7b..56638afb7 100644 --- a/Docs/Schemas/RewritableConfigJson.schema.json +++ b/Docs/Schemas/RewritableConfigJson.schema.json @@ -214,7 +214,7 @@ "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/Docs/Schemas/RewritableConfigJsonJSC.ts b/Docs/Schemas/RewritableConfigJsonJSC.ts index dc970cb78..f8e6c018f 100644 --- a/Docs/Schemas/RewritableConfigJsonJSC.ts +++ b/Docs/Schemas/RewritableConfigJsonJSC.ts @@ -208,7 +208,7 @@ export default { "type": "object", "properties": { "icon": { - "description": "question: What icon should be used?\ntype: icon\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", + "description": "question: What icon should be used?\ntypes: Use a different icon depending on the value of some attributes ; icon\nsuggestions: return Constants.defaultPinIcons.map(i => ({if: \"value=\"+i, then: i, icon: i}))", "anyOf": [ { "$ref": "#/definitions/MinimalTagRenderingConfigJson" diff --git a/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts b/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts index 0c48bc9cc..42bf7563d 100644 --- a/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts +++ b/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts @@ -4,7 +4,6 @@ import { TagConfigJson } from "./TagConfigJson" export interface IconConfigJson { /** * question: What icon should be used? - * type: icon * types: Use a different icon depending on the value of some attributes ; icon * suggestions: return Constants.defaultPinIcons.map(i => ({if: "value="+i, then: i, icon: i})) */ diff --git a/src/UI/Studio/SchemaBasedArray.svelte b/src/UI/Studio/SchemaBasedArray.svelte index 1bc20d6fa..aa80f0a55 100644 --- a/src/UI/Studio/SchemaBasedArray.svelte +++ b/src/UI/Studio/SchemaBasedArray.svelte @@ -97,11 +97,17 @@ currentValue.ping() } - function genTitle(value: any, singular: string, i: number) { - if (schema.hints.title) { - return Function("value", "return " + schema.hints.title)(value) + function genTitle(value: any, singular: string, i: number): Translation { + try { + + if (schema.hints.title) { + const v = Function("value", "return " + schema.hints.title)(value) + return Translations.T(v) + } + } catch (e) { + console.log("Warning: could not translate a title for " + `${singular} ${i} with function ` + schema.hints.title + " and value " + JSON.stringify(value)) } - return `${singular} ${i}` + return Translations.T(`${singular} ${i}`) } let genIconF: (x: any) => { icon: string; color: string } = ( @@ -166,7 +172,7 @@ {#if schema.hints.title}
- +
{/if} @@ -182,7 +188,7 @@ {:else if typeof value === "string"} Builtin: {value} {:else} - + {/if}
diff --git a/src/assets/schemas/layerconfigmeta.json b/src/assets/schemas/layerconfigmeta.json index ffe57a3bb..c4094d5b5 100644 --- a/src/assets/schemas/layerconfigmeta.json +++ b/src/assets/schemas/layerconfigmeta.json @@ -1662,7 +1662,6 @@ ], "required": true, "hints": { - "typehint": "icon", "types": "Use a different icon depending on the value of some attributes ; icon", "question": "What icon should be used?", "suggestions": [ diff --git a/src/assets/schemas/layoutconfigmeta.json b/src/assets/schemas/layoutconfigmeta.json index 10f650f8f..3d159c8b8 100644 --- a/src/assets/schemas/layoutconfigmeta.json +++ b/src/assets/schemas/layoutconfigmeta.json @@ -3661,7 +3661,6 @@ ], "required": true, "hints": { - "typehint": "icon", "types": "Use a different icon depending on the value of some attributes ; icon", "question": "What icon should be used?", "suggestions": [ @@ -24245,7 +24244,6 @@ ], "required": true, "hints": { - "typehint": "icon", "types": "Use a different icon depending on the value of some attributes ; icon", "question": "What icon should be used?", "suggestions": [