Repository navigation
Expand file tree
/
Copy pathplugin-l10n.schema.json
More file actions
169 lines (169 loc) · 7.94 KB
/
Copy pathplugin-l10n.schema.json
File metadata and controls
169 lines (169 loc) · 7.94 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
"$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; the run configuration editor checks runConfigurationTypes and beforeLaunchTasks the same way and reports plugin.build.invalidLocalization. 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" }
},
"settingRegions": {
"description": "Search keywords of settingRegions[] entries, by region ID. Translated keywords are added to the declared ones; repeats ignoring case are dropped. A region view's own text is not translated here: the backend receives the interface language with each view event and returns text in it.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][A-Za-z0-9]*(?![\\s\\S])", "maxLength": 120 },
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"keywords": {
"type": "array",
"minItems": 1,
"maxItems": 32,
"items": { "type": "string", "minLength": 1, "maxLength": 64, "pattern": "^\\S(?:[^\\u0000-\\u001f\\u007f]*\\S)?(?![\\s\\S])" }
}
}
}
},
"runConfigurationTypes": {
"description": "Text of buildSystems[].runConfigurationTypes, by build system ID, then type ID.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])", "maxLength": 64 },
"additionalProperties": {
"type": "object",
"propertyNames": { "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])", "maxLength": 64 },
"additionalProperties": { "$ref": "#/$defs/runTypeText" }
}
},
"beforeLaunchTasks": {
"description": "Text of buildSystems[].beforeLaunchTasks, by build system ID, then task ID, shaped like runConfigurationTypes.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])", "maxLength": 64 },
"additionalProperties": {
"type": "object",
"propertyNames": { "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])", "maxLength": 64 },
"additionalProperties": { "$ref": "#/$defs/runTypeText" }
}
},
"buildOptions": {
"description": "Text of buildSystems[].options, by build system ID, then option ID. Core applies it to the manifest (build.localizeOptions), so every surface that shows an option shows it translated.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][a-z0-9-]*(?![\\s\\S])", "maxLength": 64 },
"additionalProperties": {
"type": "object",
"propertyNames": { "pattern": "^[a-z][A-Za-z0-9]*(?![\\s\\S])", "maxLength": 120 },
"additionalProperties": { "$ref": "#/$defs/optionText" }
}
}
},
"$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" }
}
}
},
"runTypeText": {
"description": "Each member replaces the field of the same name; plugin.json must have that field.",
"type": "object",
"additionalProperties": false,
"properties": {
"displayName": { "$ref": "#/$defs/label" },
"description": { "$ref": "#/$defs/runTypeDescription" },
"fields": {
"description": "Field text, by field ID.",
"type": "object",
"propertyNames": { "pattern": "^[a-z][A-Za-z0-9]*(?![\\s\\S])", "maxLength": 120 },
"additionalProperties": {
"type": "object",
"additionalProperties": false,
"properties": {
"title": { "$ref": "#/$defs/label" },
"description": { "$ref": "#/$defs/runTypeDescription" },
"placeholder": { "$ref": "#/$defs/label" },
"options": {
"description": "choice fields only: choice titles, by choice value.",
"type": "object",
"propertyNames": { "minLength": 1, "maxLength": 256 },
"additionalProperties": { "$ref": "#/$defs/label" }
}
}
}
}
}
},
"runTypeDescription": {
"description": "Not only whitespace, at most 512 bytes; may hold line breaks.",
"type": "string",
"minLength": 1,
"maxLength": 512,
"pattern": "\\S"
},
"optionText": {
"description": "Each member replaces the field of the same name; plugin.json must have that field.",
"type": "object",
"additionalProperties": false,
"properties": {
"displayName": { "$ref": "#/$defs/label" },
"description": { "$ref": "#/$defs/runTypeDescription" },
"choices": {
"description": "Titles of declared choices, by choice value.",
"type": "object",
"propertyNames": { "minLength": 1, "maxLength": 256 },
"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" }
}
}
}
}