-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathschema.json
279 lines (279 loc) · 8.93 KB
/
schema.json
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
{
"type": "object",
"properties": {
"projectId": {
"description": "Project ID. Only required when using a Personal Access Token.",
"type": ["number", "string"]
},
"apiUrl": {
"description": "The url of Tolgee API.",
"type": "string"
},
"apiKey": {
"description": "Api key to Tolgee Platform.\n\nWARNING: Make sure you don't leak your API key\nUse `apiKey` only if you are loading it from an environment or other secured source (supported in .js or .yml files) or your config is not public.\n\nIn most cases, it's better to use a one-time `login` command or set it via the `TOLGEE_API_KEY` environment variable.",
"type": "string"
},
"format": {
"$ref": "#/$defs/format"
},
"extractor": {
"description": "A path to a custom extractor to use instead of the default one.",
"type": "string"
},
"patterns": {
"description": "File glob patterns to your source code, used for keys extraction.",
"type": "array",
"items": {
"type": "string"
}
},
"strictNamespace": {
"description": "Require namespace to be reachable, turn off if you don't use namespaces. (Default: true)",
"type": "boolean"
},
"defaultNamespace": {
"description": "Default namespace used in extraction if not specified otherwise.",
"type": "string"
},
"parser": {
"description": "Override parser detection.",
"enum": ["react", "vue", "svelte", "ngx"]
},
"push": {
"type": "object",
"properties": {
"files": {
"description": "Define, which files should be pushed and attach language/namespace to them. By default Tolgee pushes all files specified here, you can filter them by languages and namespaces properties.",
"type": "array",
"items": { "$ref": "#/$defs/fileMatch" }
},
"languages": {
"description": "Specifies which languages should be pushed from push.files.",
"type": "array",
"items": { "type": "string" }
},
"namespaces": {
"description": "Specifies which namespaces should be pushed from push.files.",
"type": "array",
"items": { "type": "string" }
},
"forceMode": {
"$ref": "#/$defs/forceMode"
},
"overrideKeyDescriptions": {
"description": "Override existing key descriptions from local files (only relevant for some formats).",
"type": "boolean"
},
"convertPlaceholdersToIcu": {
"description": "Convert placeholders in local files to ICU format. (Default: true)",
"type": "boolean"
},
"tagNewKeys": {
"description": "Specify tags that will be added to newly created keys.",
"type": "array",
"items": {
"type": "string"
}
},
"removeOtherKeys": {
"description": "Remove keys which are not present in the import.",
"type": "boolean"
}
}
},
"pull": {
"type": "object",
"properties": {
"path": {
"description": "Path to a folder where the localization files are stored. (Structure itself can be defined with `fileStructureTemplate`)",
"type": "string"
},
"languages": {
"description": "List of languages to pull. Leave unspecified to export them all.",
"type": "array",
"items": {
"type": "string"
}
},
"namespaces": {
"description": "List of namespaces to pull. Defaults to all namespaces.",
"type": "array",
"items": {
"type": "string"
}
},
"states": {
"description": "List of translation states to include. Defaults all except untranslated.",
"type": "array",
"items": {
"enum": ["UNTRANSLATED", "TRANSLATED", "REVIEWED"]
}
},
"tags": {
"description": "List of tags which to include.",
"type": "array",
"items": {
"type": "string"
}
},
"excludeTags": {
"description": "List of tags which to exclude.",
"type": "array",
"items": {
"type": "string"
}
},
"supportArrays": {
"description": "Export keys with array syntax (e.g. item[0]) as arrays.",
"type": "boolean"
},
"fileStructureTemplate": {
"description": "Defines exported file structure: https://tolgee.io/tolgee-cli/push-pull-strings#file-structure-template-format",
"type": "string"
},
"emptyDir": {
"description": "Empty [path] folder before inserting pulled files.",
"type": "boolean"
},
"delimiter": {
"description": "Structure delimiter to use. By default, Tolgee interprets `.` as a nested structure. You can change the delimiter, or disable structure formatting by not specifying any value to the option.",
"type": ["string", "null"]
}
}
},
"sync": {
"type": "object",
"properties": {
"backup": {
"description": "Store translation files backup (only translation files, not states, comments, tags, etc.). If something goes wrong, the backup can be used to restore the project to its previous state.",
"type": "string"
},
"continueOnWarning": {
"description": "Continue the sync regardless of whether warnings are detected during string extraction. By default, as warnings may indicate an invalid extraction, the CLI will abort the sync.",
"type": "boolean"
},
"removeUnused": {
"description": "Delete unused keys from the Tolgee project",
"type": "boolean"
}
}
},
"tag": {
"type": "object",
"properties": {
"filterExtracted": {
"description": "Extract keys from code and filter by it.",
"type": "boolean"
},
"filterNotExtracted": {
"description": "Extract keys from code and filter them out.",
"type": "boolean"
},
"filterTag": {
"description": "Filter only keys with tag. Use * as a wildcard.",
"type": "array",
"items": {
"type": "string"
}
},
"filterNoTag": {
"description": "Filter only keys without tag. Use * as a wildcard.",
"type": "array",
"items": {
"type": "string"
}
},
"tag": {
"description": "Add tag to filtered keys.",
"type": "array",
"items": {
"type": "string"
}
},
"tagOther": {
"description": "Tag keys which are not filtered.",
"type": "array",
"items": {
"type": "string"
}
},
"untag": {
"description": "Remove tag from filtered keys. Use * as a wildcard.",
"type": "array",
"items": {
"type": "string"
}
},
"untagOther": {
"description": "Remove tag from keys which are not filtered. Use * as a wildcard.",
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"$defs": {
"fileMatch": {
"type": "object",
"properties": {
"path": { "$ref": "#/$defs/path" },
"language": { "type": "string" },
"namespace": { "type": "string" }
},
"required": ["path", "language"]
},
"forceMode": {
"description": "Specifies how to solve potential conflicts in the pushed data.\n\nOptions:\n\n `OVERRIDE` - update everything according to local files\n `KEEP` - create only non-existent strings, don't touch existing ones\n `NO_FORCE` - throw an error, if there are any conflict",
"type": "string",
"enum": ["OVERRIDE", "KEEP", "NO_FORCE"]
},
"path": {
"description": "File glob specifying which files to include.",
"type": "string"
},
"format": {
"description": "Localization files format for push and pull operations.",
"enum": [
"JSON_TOLGEE",
"JSON_ICU",
"JSON_I18NEXT",
"JSON_JAVA",
"JSON_PHP",
"JSON_RUBY",
"JSON_C",
"PO_PHP",
"PO_C",
"PO_JAVA",
"PO_ICU",
"PO_RUBY",
"PO_PYTHON",
"APPLE_STRINGS",
"APPLE_XLIFF",
"PROPERTIES_ICU",
"PROPERTIES_JAVA",
"ANDROID_XML",
"COMPOSE_XML",
"FLUTTER_ARB",
"CSV_ICU",
"CSV_JAVA",
"CSV_PHP",
"CSV_RUBY",
"YAML_RUBY",
"YAML_JAVA",
"YAML_ICU",
"YAML_PHP",
"XLIFF_ICU",
"XLIFF_JAVA",
"XLIFF_PHP",
"XLIFF_RUBY",
"RESX_ICU",
"XLSX_ICU",
"XLSX_JAVA",
"XLSX_PHP",
"XLSX_RUBY"
]
}
}
}