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.
Files changed (3) hide show
  1. package/README.md +29 -15
  2. package/dist/index.js +1 -1
  3. 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 (per-language objects support `state`; translated` by default)
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 list
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 list --key good*
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 list --languages en
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 list --format "[{{language}}] {{key}} => {{text}}"
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
- ## Command options
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 options
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 options
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
- ### `list` command options
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
- ```json5
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 options for the config file:
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.a
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 not check the supported languages in your Xcode project.
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
@@ -2582,7 +2582,7 @@ function Ln(e, {
2582
2582
  }
2583
2583
  function Vo() {
2584
2584
  return {
2585
- command: "list",
2585
+ command: "strings",
2586
2586
  describe: "List strings in the xcstrings file",
2587
2587
  builder: (e) => e.option("key", {
2588
2588
  type: "string",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xcstrings-cli",
3
- "version": "2.3.0",
3
+ "version": "2.4.0",
4
4
  "description": "A command line tool for handling xcstrings files.",
5
5
  "type": "module",
6
6
  "bin": {