xcstrings-cli 2.2.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.
Files changed (3) hide show
  1. package/README.md +21 -6
  2. package/dist/index.js +937 -895
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -59,18 +59,25 @@ 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 (per-language objects support `state`; translated` by default)
63
63
  xcs add --strings << EOF
64
64
  greeting:
65
65
  translations:
66
66
  en: Hello, World.
67
- ja: こんにちは、世界。
67
+ ja:
68
+ state: needs_review
69
+ value: こんにちは、世界。
68
70
  zh-Hans: 你好,世界。
69
71
  comment: A greeting message.
70
72
  farewell:
71
- en: Goodbye, World.
72
- ja: さようなら、世界。
73
- zh-Hans: 再见,世界。
73
+ translations:
74
+ en: Goodbye, World.
75
+ ja:
76
+ state: needs_review
77
+ value: さよなら、世界。
78
+ zh-Hans:
79
+ state: stale
80
+ value: さようなら、世界。
74
81
  comment: A farewell message.
75
82
  EOF
76
83
 
@@ -157,7 +164,7 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
157
164
 
158
165
  ### `add` command options
159
166
 
160
- * `--key, -k`: `string` (Required)
167
+ * `--key, -k`: `string` (Required unless `--strings` contains one or more keys)
161
168
  * The key of the string to add.
162
169
  * `--language, -l`: `string` (Optional)
163
170
  * The language of the string provided with `--text`.
@@ -166,6 +173,14 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
166
173
  * Validation follows `missingLanguagePolicy`: `skip` requires the language to be supported; `include` allows any language.
167
174
  * `--text`: `string` (Optional)
168
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.
169
184
  * `--strings`: `string` (Optional)
170
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).
171
186
  * The format is determined by `--strings-format`.