You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
List<String>. File glob patterns to your source code, used for key extraction.
93
+
List[String]. File glob patterns to your source code, used for key extraction.
96
94
97
95
### `strictNamespace`
98
96
@@ -104,24 +102,40 @@ String. Default namespace used in extraction if not specified otherwise.
104
102
105
103
### `parser`
106
104
107
-
Enum<`react`|`vue`|`svelte`>. Tolgee detects which parser to use automatically from the extensions of matched files, with this option you can override it.
105
+
Enum[`react`|`vue`|`svelte`]. Tolgee detects which parser to use automatically from the extensions of matched files, with this option you can override it.
108
106
109
107
110
108
## Push options
111
109
112
110
Related to `push` command, which imports the keys into the platform.
113
111
112
+
### `push.filesTemplate`
113
+
114
+
String or String[]. A template that describes the structure of the local files and their location.
Full syntax is explained [here](./push-pull-strings.mdx#file-structure-template-format)
119
+
114
120
### `push.files`
115
121
122
+
More explicit alternative to `filesTemplate`.
123
+
116
124
`List<{path: string, language: string, namespace?: string}>`. 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. Path can be a glob, if you want to include multiple files.
117
125
126
+
:::info `push.filesTemplate` vs `push.files`
127
+
We recommend usage of [`push.filesTemplate`](#pushfilestemplate), which can describe your local localization file structure
128
+
with single option. `push.files` requires you to specify each pushed file individually, but can be useful, if you have a weird file
129
+
structure or you want to remap language tags.
130
+
:::
131
+
118
132
### `push.languages`
119
133
120
-
List<String>. Specifies which languages should be pushed from `push.files`.
134
+
List[String]. Specifies which languages should be pushed from `push.files`.
121
135
122
136
### `push.namespaces`
123
137
124
-
List<String>. Specifies which namespaces should be pushed from `push.files`.
138
+
List[String]. Specifies which namespaces should be pushed from `push.files`.
125
139
126
140
### `push.forceMode`
127
141
@@ -142,7 +156,7 @@ Boolean. Convert placeholders in local files to ICU format. (Default: `true`)
142
156
143
157
### `push.tagNewKeys`
144
158
145
-
List<String>. Specify tags that will be added to newly created keys.
159
+
List[String]. Specify tags that will be added to newly created keys.
146
160
147
161
### `push.removeOtherKeys`
148
162
@@ -165,23 +179,23 @@ behavior by specifying `null` or empty string `""`.
165
179
166
180
### `pull.languages`
167
181
168
-
List<String>. List of languages to pull. Leave unspecified to export them all.
182
+
List[String]. List of languages to pull. Leave unspecified to export them all.
169
183
170
184
### `pull.namespaces`
171
185
172
-
List<String>. List of namespaces to pull. Defaults to all namespaces.
186
+
List[String]. List of namespaces to pull. Defaults to all namespaces.
173
187
174
188
### `pull.states`
175
189
176
-
List<String>. List of translation states to include. Defaults all except untranslated.
190
+
List[String]. List of translation states to include. Defaults all except untranslated.
177
191
178
192
### `pull.tags`
179
193
180
-
List<String>. List of tags which to include.
194
+
List[String]. List of tags which to include.
181
195
182
196
### `pull.excludeTags`
183
197
184
-
List<String>. List of tags which to exclude.
198
+
List[String]. List of tags which to exclude.
185
199
186
200
### `pull.supportArrays`
187
201
@@ -191,13 +205,9 @@ Boolean. Export keys with array syntax (e.g. `item[0]`) as arrays.
191
205
192
206
String. This is a template that defines the structure of the resulting .zip file content.
193
207
194
-
The template is a string that can contain the following placeholders: `{namespace}`, `{languageTag}`, `{androidLanguageTag}`, `{snakeLanguageTag}`, `{extension}`.
195
-
196
-
For example, when exporting to JSON with the template `{namespace}/{languageTag}.{extension}`, the English translations of the home namespace will be stored in home/en.json.
197
-
198
-
The `{snakeLanguageTag}` placeholder is the same as `{languageTag}` but in snake case. (e.g., en_US).
208
+
Example: `{namespace}/{languageTag}.{extension}`
199
209
200
-
The Android specific `{androidLanguageTag}` placeholder is the same as `{languageTag}` but in Android format. (e.g., en-rUS)
210
+
Full syntax is explained [here](./push-pull-strings.mdx#file-structure-template-format)
201
211
202
212
### `pull.emptyDir`
203
213
@@ -229,24 +239,24 @@ Boolean. Extract keys from code and filter them out.
229
239
230
240
### `tag.filterTag`
231
241
232
-
List<String>. Filter only keys with tag. Use * as a wildcard.
242
+
List[String]. Filter only keys with tag. Use * as a wildcard.
233
243
234
244
### `tag.filterNoTag`
235
245
236
-
List<String>. Filter only keys without tag. Use * as a wildcard.
246
+
List[String]. Filter only keys without tag. Use * as a wildcard.
237
247
238
248
### `tag.tag`
239
249
240
-
List<String>. Add tag to filtered keys.
250
+
List[String]. Add tag to filtered keys.
241
251
242
252
### `tag.tagOther`
243
253
244
-
List<String>. Tag keys which are not filtered.
254
+
List[String]. Tag keys which are not filtered.
245
255
246
256
### `tag.untag`
247
257
248
-
List<String>. Remove tag from filtered keys. Use * as a wildcard.
258
+
List[String]. Remove tag from filtered keys. Use * as a wildcard.
249
259
250
260
### `tag.untagOther`
251
261
252
-
List<String>. Remove tag from keys which are not filtered. Use * as a wildcard.
262
+
List[String]. Remove tag from keys which are not filtered. Use * as a wildcard.
This is a template that defines the structure of the resulting .zip file content.
38
-
39
-
The template is a string that can contain the following placeholders: `{namespace}`, `{languageTag}`, `{androidLanguageTag}`, `{snakeLanguageTag}`, `{extension}`.
40
-
41
-
For example, when exporting to JSON with the template `{namespace}`/`{languageTag}`.`{extension}`, the English translations of the home namespace will be stored in home/en.json.
42
-
43
-
The `{snakeLanguageTag}` placeholder is the same as `{languageTag}` but in snake case. (e.g., en_US).
44
-
45
-
The Android specific `{androidLanguageTag}` placeholder is the same as `{languageTag}` but in Android format. (e.g., en-rUS)
Push command requires [`push.files`](./project-configuration.mdx#pushfiles) in config (which specifies which files to import).
60
-
:::
61
-
62
47
Options:
63
-
48
+
-`--files-template <templates...>` (short: `-ft`) - A template that describes the structure of the local files and their location with [file structure template format](#file-structure-template-format). Example: `./public/{namespace}/{languageTag}.json`
64
49
-`--force-mode <mode>` (short: `-f`) – What should we do with possible conflicts? Available modes: `OVERRIDE`, `KEEP`, `NO_FORCE` (abort on conflicts). Defaults to asking the user interactively (or `NO_FORCE` if it is not possible).
65
50
-`--override-key-descriptions` - Override existing key descriptions from local files (only relevant for some formats).
66
51
-`--convert-placeholders-to-icu` - Convert placeholders in local files to ICU format. (Default: true)
67
52
-`--languages <languages...>` (short `-l`) - Specifies which languages should be pushed (see `push.files` in config).
68
53
-`--namespaces <namespaces...>` (short `-n`) - Specifies which namespaces should be pushed (see `push.files` in config).
69
54
-`--tag-new-keys <tags...>` - Specify tags that will be added to newly created keys.
70
55
-`--remove-other-keys` - Remove keys which are not present in the import.
56
+
57
+
58
+
### File structure template format
59
+
This is a template that defines the structure of static files and mapping them to languages/namespaces.
60
+
61
+
The template is a string that can contain the following placeholders: `{namespace}`, `{languageTag}`, `{androidLanguageTag}`, `{snakeLanguageTag}`, `{extension}`.
62
+
63
+
For example, when exporting to JSON with the template `{namespace}`/`{languageTag}`.`{extension}`, the English translations of the home namespace will be stored in home/en.json.
64
+
65
+
The `{snakeLanguageTag}` placeholder is the same as `{languageTag}` but in snake case. (e.g., en_US).
66
+
67
+
The Android specific `{androidLanguageTag}` placeholder is the same as `{languageTag}` but in Android format. (e.g., en-rUS)
68
+
69
+
> `--files-template` option also allows usage of glob wildcards as (`*`, `**` or `{json,yaml}`)
0 commit comments