Repository navigation
Expand file tree
/
Copy pathplugin-l10n.schema.json
More file actions
71 lines (71 loc) · 3.5 KB
/
Copy pathplugin-l10n.schema.json
File metadata and controls
71 lines (71 loc) · 3.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/Lithe-IDEA/Lithe-core-rust/main/shared/plugins/contract/v1/plugin-l10n.schema.json",
"title": "Lithe plugin translation file (plugin contract v1)",
"description": "Shape of l10n/<language>.json in a plugin package, such as l10n/zh-Hans.json: the plugin's own text in one interface language. Every member is optional, and text it leaves out stays as written in plugin.json. Rules that JSON Schema cannot express (every ID, option value and heading must exist in plugin.json, a field is translated only when plugin.json has it, no key repeats) are defined in README.md and enforced by plugins.declarative.settingsState, which reports a file that breaks one with plugin.settings.invalidLocalization and applies none of it. Core ignores top-level members it does not know, so a file that also translates text a later host supports stays usable on older hosts; this schema lists only the members Core reads today.",
"type": "object",
"additionalProperties": false,
"properties": {
"$schema": { "description": "Editor hint only; Core ignores it.", "type": "string" },
"settings": {
"description": "Text of settings[] entries, by setting ID.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][A-Za-z0-9]*(?![\\s\\S])", "maxLength": 120 },
"additionalProperties": { "$ref": "#/$defs/settingText" }
},
"sections": {
"description": "Shown text of section headings, by the heading exactly as written in a setting's or action's section. Grouping and order still follow the original heading.",
"type": "object",
"propertyNames": { "minLength": 1, "maxLength": 120 },
"additionalProperties": { "$ref": "#/$defs/label" }
},
"settingActions": {
"description": "Text of settingActions[] entries, by action ID.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][A-Za-z0-9]*(?![\\s\\S])", "maxLength": 120 },
"additionalProperties": { "$ref": "#/$defs/actionText" }
}
},
"$defs": {
"label": {
"description": "Short text: not only whitespace, at most 120 characters.",
"type": "string",
"minLength": 1,
"maxLength": 120,
"pattern": "\\S"
},
"description": {
"description": "Not only whitespace, at most 480 characters.",
"type": "string",
"minLength": 1,
"maxLength": 480,
"pattern": "\\S"
},
"settingText": {
"description": "Each member replaces the field of the same name; plugin.json must have that field.",
"type": "object",
"additionalProperties": false,
"properties": {
"title": { "$ref": "#/$defs/label" },
"description": { "$ref": "#/$defs/description" },
"placeholder": { "$ref": "#/$defs/label" },
"unit": { "$ref": "#/$defs/label" },
"options": {
"description": "enum and multiSelect only: option titles, by option value. Values and their order stay as declared.",
"type": "object",
"propertyNames": { "pattern": "^[A-Za-z0-9._-]+(?![\\s\\S])", "maxLength": 120 },
"additionalProperties": { "$ref": "#/$defs/label" }
}
}
},
"actionText": {
"description": "Each member replaces the field of the same name; plugin.json must have that field.",
"type": "object",
"additionalProperties": false,
"properties": {
"title": { "$ref": "#/$defs/label" },
"description": { "$ref": "#/$defs/description" }
}
}
}
}