xcstrings-cli 2.3.0 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -15
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ xcs add \
|
|
|
59
59
|
--strings-format yaml \
|
|
60
60
|
--strings < translations.yaml
|
|
61
61
|
|
|
62
|
-
# Add multiple strings via heredoc
|
|
62
|
+
# Add multiple strings via heredoc
|
|
63
63
|
xcs add --strings << EOF
|
|
64
64
|
greeting:
|
|
65
65
|
translations:
|
|
@@ -110,7 +110,7 @@ xcs languages
|
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
112
|
# List all strings
|
|
113
|
-
xcs
|
|
113
|
+
xcs strings
|
|
114
114
|
# helloWorld:
|
|
115
115
|
# en: "Hello, World."
|
|
116
116
|
# ja: "こんにちは、世界。"
|
|
@@ -124,14 +124,14 @@ xcs list
|
|
|
124
124
|
# ... etc.
|
|
125
125
|
|
|
126
126
|
# List strings filtered by key
|
|
127
|
-
xcs
|
|
127
|
+
xcs strings --key good*
|
|
128
128
|
# goodbyeWorld:
|
|
129
129
|
# ...
|
|
130
130
|
# goodMorning:
|
|
131
131
|
# ...
|
|
132
132
|
|
|
133
133
|
# List strings filtered by language
|
|
134
|
-
xcs
|
|
134
|
+
xcs strings --languages en
|
|
135
135
|
# helloWorld:
|
|
136
136
|
# en: "Hello, World."
|
|
137
137
|
# goodbyeWorld:
|
|
@@ -141,7 +141,7 @@ xcs list --languages en
|
|
|
141
141
|
# ... etc.
|
|
142
142
|
|
|
143
143
|
# List strings with custom format
|
|
144
|
-
xcs
|
|
144
|
+
xcs strings --format "[{{language}}] {{key}} => {{text}}"
|
|
145
145
|
# [en] helloWorld => "Hello, World."
|
|
146
146
|
# [ja] helloWorld => "こんにちは、世界。"
|
|
147
147
|
# [en] goodbyeWorld => "Goodbye, World."
|
|
@@ -150,7 +150,10 @@ xcs list --format "[{{language}}] {{key}} => {{text}}"
|
|
|
150
150
|
```
|
|
151
151
|
|
|
152
152
|
You can use `xcs --help` or `xcs <sub-command> --help` to see the list of commands and options.
|
|
153
|
-
|
|
153
|
+
|
|
154
|
+
## Commands
|
|
155
|
+
|
|
156
|
+
### Global options
|
|
154
157
|
|
|
155
158
|
* `--help, -h`: `boolean` (Optional)
|
|
156
159
|
* Show help.
|
|
@@ -162,7 +165,9 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
|
|
|
162
165
|
* The xcstrings file path. Defaults to `Localizable.xcstrings` in the current directory, or to the first `xcstringsPaths` entry in the config when present.
|
|
163
166
|
* You can also specify the alias you set in the config file. (`xcstringsPaths` entry with `alias` field)
|
|
164
167
|
|
|
165
|
-
### `add` command
|
|
168
|
+
### `add` command
|
|
169
|
+
|
|
170
|
+
Adds/updates one or more strings to the xcstrings file.
|
|
166
171
|
|
|
167
172
|
* `--key, -k`: `string` (Required unless `--strings` contains one or more keys)
|
|
168
173
|
* The key of the string to add.
|
|
@@ -192,7 +197,9 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
|
|
|
192
197
|
* `--comment`: `string` (Optional)
|
|
193
198
|
* The comment for the string to add, intended for translators.
|
|
194
199
|
|
|
195
|
-
### `remove` command
|
|
200
|
+
### `remove` command
|
|
201
|
+
|
|
202
|
+
Removes strings from the xcstrings file based on the specified filter options.
|
|
196
203
|
|
|
197
204
|
* `--key, -k`: `string` (Optional if `languages` is specified)
|
|
198
205
|
* The key of the string to remove. If not specified, xcstrings-cli will remove all strings for the specified languages.
|
|
@@ -201,7 +208,9 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
|
|
|
201
208
|
* `--dry-run, -n`: `boolean` (Optional, default: `false`)
|
|
202
209
|
* If set to `true`, `xcs` will only show what would be removed without actually removing anything.
|
|
203
210
|
|
|
204
|
-
### `
|
|
211
|
+
### `strings` command
|
|
212
|
+
|
|
213
|
+
Lists strings in the xcstrings file, with optional filtering and formatting.
|
|
205
214
|
|
|
206
215
|
* `--languages, -l`: `string[]` (Optional)
|
|
207
216
|
* Include only the specified languages.
|
|
@@ -223,7 +232,10 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
|
|
|
223
232
|
## Config file
|
|
224
233
|
|
|
225
234
|
Put an `xcstrings-cli.json5` or `xcstrings-cli.json` file in the project root, and xcs will use it as the config file.
|
|
226
|
-
|
|
235
|
+
|
|
236
|
+
Here is an example config file in JSON format:
|
|
237
|
+
|
|
238
|
+
```json
|
|
227
239
|
{
|
|
228
240
|
"xcstringsPaths": [
|
|
229
241
|
"Shared/L10n/Localizable.xcstrings",
|
|
@@ -234,19 +246,21 @@ Put an `xcstrings-cli.json5` or `xcstrings-cli.json` file in the project root, a
|
|
|
234
246
|
],
|
|
235
247
|
"xcodeprojPaths": [
|
|
236
248
|
"path/to/your/Project.xcodeproj"
|
|
237
|
-
]
|
|
249
|
+
],
|
|
250
|
+
"missingLanguagePolicy": "include"
|
|
238
251
|
}
|
|
239
252
|
```
|
|
240
253
|
|
|
241
|
-
These are the
|
|
254
|
+
These are the settings you can specify in the config file:
|
|
242
255
|
|
|
243
256
|
* **xcstringsPaths**: `string[] | { alias: string, path: string }[]` (Optional)
|
|
244
257
|
* Paths to xcstrings files used by `xcs`.
|
|
245
258
|
* If only one path is provided, `xcs` will use it as the default xcstrings file.
|
|
246
|
-
* If multiple paths are provided, `xcs` will ask you to select an xcstrings file.
|
|
259
|
+
* If multiple paths are provided, `xcs` will ask you to select an xcstrings file.
|
|
260
|
+
* You can also specify an alias, and use it with the `--path` option.
|
|
247
261
|
* **xcodeprojPaths**: `string[]` (Optional)
|
|
248
|
-
* Paths to Xcode project files used to detect supported languages.
|
|
249
|
-
* If not specified, `xcs` will
|
|
262
|
+
* Paths to Xcode project files (`.xcodeproj`) used to detect supported languages.
|
|
263
|
+
* If not specified, `xcs` will only check the xcstrings file to detect supported languages.
|
|
250
264
|
* **missingLanguagePolicy**: `string` (Optional, default: `skip`)
|
|
251
265
|
* How to handle translations for languages that are not included in the `xcs languages` output when adding strings. Options are:
|
|
252
266
|
* `skip`: Only add translations for languages included in the `xcs languages` output. (Default)
|
package/dist/index.js
CHANGED