xcstrings-cli 2.0.0 → 2.1.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 +63 -1
  2. package/dist/index.js +1793 -1368
  3. package/package.json +4 -2
package/README.md CHANGED
@@ -15,7 +15,7 @@ We also provide a Custom GPT that can help you generate translations and output
15
15
 
16
16
  This will install the `xcs` command globally.
17
17
 
18
- 2. Initialize xcstrings-cli:
18
+ 2. Create a configuration file for your project by running:
19
19
  ```bash
20
20
  xcs init
21
21
  ```
@@ -84,6 +84,49 @@ xcs languages
84
84
  # en ja zh-Hans
85
85
  ```
86
86
 
87
+ **List strings in the xcstrings file:**
88
+
89
+ ```bash
90
+ # List all strings
91
+ xcs list
92
+ # helloWorld:
93
+ # en: "Hello, World."
94
+ # ja: "こんにちは、世界。"
95
+ # zh-Hans: "你好,世界。"
96
+ # goodbyeWorld:
97
+ # en: "Goodbye, World."
98
+ # ja: "さようなら、世界。"
99
+ # goodMorning:
100
+ # en: "Good morning."
101
+ # ja: "おはようございます。"
102
+ # ... etc.
103
+
104
+ # List strings filtered by key
105
+ xcs list --key good*
106
+ # goodbyeWorld:
107
+ # ...
108
+ # goodMorning:
109
+ # ...
110
+
111
+ # List strings filtered by language
112
+ xcs list --languages en
113
+ # helloWorld:
114
+ # en: "Hello, World."
115
+ # goodbyeWorld:
116
+ # en: "Goodbye, World."
117
+ # goodMorning:
118
+ # en: "Good morning."
119
+ # ... etc.
120
+
121
+ # List strings with custom format
122
+ xcs list --format "[{{language}}] {{key}} => {{text}}"
123
+ # [en] helloWorld => "Hello, World."
124
+ # [ja] helloWorld => "こんにちは、世界。"
125
+ # [en] goodbyeWorld => "Goodbye, World."
126
+ # [ja] goodbyeWorld => "さようなら、世界。"
127
+ # ... etc.
128
+ ```
129
+
87
130
  You can use `xcs --help` or `xcs <sub-command> --help` to see the list of commands and options.
88
131
  ## Command options
89
132
 
@@ -128,6 +171,25 @@ You can use `xcs --help` or `xcs <sub-command> --help` to see the list of comman
128
171
  * `--dry-run, -n`: `boolean` (Optional, default: `false`)
129
172
  * If set to `true`, `xcs` will only show what would be removed without actually removing anything.
130
173
 
174
+ ### `list` command options
175
+
176
+ * `--languages, -l`: `string[]` (Optional)
177
+ * Include only the specified languages.
178
+ * `--key`, `--key-glob`: `string` (Optional)
179
+ * Filter keys by glob pattern. This is the default key filter mode.
180
+ * `--key-regex`: `string` (Optional)
181
+ * Filter keys by regular expression.
182
+ * `--key-substring`: `string` (Optional)
183
+ * Filter keys by substring match.
184
+ * `--text`, `--text-glob`: `string` (Optional)
185
+ * Filter translations by glob pattern. This is the default text filter mode.
186
+ * `--text-regex`: `string` (Optional)
187
+ * Filter translations by regular expression.
188
+ * `--text-substring`: `string` (Optional)
189
+ * Filter translations by substring match.
190
+ * `--format`: `string` (Optional)
191
+ * Mustache template for per-localization output. Available variables: `{{language}}`, `{{key}}`, `{{text}}`.
192
+
131
193
  ## Config file
132
194
 
133
195
  Put an `xcstrings-cli.json5` or `xcstrings-cli.json` file in the project root, and xcs will use it as the config file.