xcstrings-cli 2.1.0 → 2.3.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 +39 -1
- package/dist/index.js +1274 -1151
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,6 +59,28 @@ 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)
|
|
63
|
+
xcs add --strings << EOF
|
|
64
|
+
greeting:
|
|
65
|
+
translations:
|
|
66
|
+
en: Hello, World.
|
|
67
|
+
ja:
|
|
68
|
+
state: needs_review
|
|
69
|
+
value: こんにちは、世界。
|
|
70
|
+
zh-Hans: 你好,世界。
|
|
71
|
+
comment: A greeting message.
|
|
72
|
+
farewell:
|
|
73
|
+
translations:
|
|
74
|
+
en: Goodbye, World.
|
|
75
|
+
ja:
|
|
76
|
+
state: needs_review
|
|
77
|
+
value: さよなら、世界。
|
|
78
|
+
zh-Hans:
|
|
79
|
+
state: stale
|
|
80
|
+
value: さようなら、世界。
|
|
81
|
+
comment: A farewell message.
|
|
82
|
+
EOF
|
|
83
|
+
|
|
62
84
|
# Add with only key and comment
|
|
63
85
|
xcs add --key greeting --comment "A greeting message."
|
|
64
86
|
```
|
|
@@ -142,7 +164,7 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
|
|
|
142
164
|
|
|
143
165
|
### `add` command options
|
|
144
166
|
|
|
145
|
-
* `--key, -k`: `string` (Required)
|
|
167
|
+
* `--key, -k`: `string` (Required unless `--strings` contains one or more keys)
|
|
146
168
|
* The key of the string to add.
|
|
147
169
|
* `--language, -l`: `string` (Optional)
|
|
148
170
|
* The language of the string provided with `--text`.
|
|
@@ -151,6 +173,14 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
|
|
|
151
173
|
* Validation follows `missingLanguagePolicy`: `skip` requires the language to be supported; `include` allows any language.
|
|
152
174
|
* `--text`: `string` (Optional)
|
|
153
175
|
* The string value for the language. If omitted, the key is created without a localization for the default language.
|
|
176
|
+
* `--state`: `string` (Optional, default: `translated`)
|
|
177
|
+
* Values applied to single-key and multi-key adds: `translated`, `needs_review`, `new`, `stale`. If omitted, strings default to `translated`.
|
|
178
|
+
* Multi-key payloads can also set per-language states with `{ state, value }`; string shorthand is treated as `translated`.
|
|
179
|
+
* State meanings:
|
|
180
|
+
* `translated`: The string is translated and ready to use.
|
|
181
|
+
* `needs_review`: The string needs review by a translator.
|
|
182
|
+
* `new`: The string is newly added and not yet translated.
|
|
183
|
+
* `stale`: The string is outdated and may need re-translation.
|
|
154
184
|
* `--strings`: `string` (Optional)
|
|
155
185
|
* Translation-including JSON or YAML for the key. Pass inline JSON, or provide the flag without a value to read it from stdin (heredoc/pipe).
|
|
156
186
|
* The format is determined by `--strings-format`.
|
|
@@ -222,6 +252,14 @@ These are the options for the config file:
|
|
|
222
252
|
* `skip`: Only add translations for languages included in the `xcs languages` output. (Default)
|
|
223
253
|
* `include`: Add translations even when they are not recognized by the Xcode project or xcs language list.
|
|
224
254
|
|
|
255
|
+
## Q&A
|
|
256
|
+
|
|
257
|
+
**Q: Strings are not being added for some languages. Why?**
|
|
258
|
+
|
|
259
|
+
A: By default, `xcs` only adds translations for languages that are recognized in your Xcode project (knownRegions) or the xcstrings file. You can check which languages are recognized by running `xcs languages`.
|
|
260
|
+
|
|
261
|
+
If you want to add translations for languages not included in your Xcode project, you can change the `missingLanguagePolicy` in your config file to `include`.
|
|
262
|
+
|
|
225
263
|
## LICENSE
|
|
226
264
|
|
|
227
265
|
MIT
|