Skip to content

Commit 8c09c2f

Browse files
committed
Update documents
1 parent e561d9c commit 8c09c2f

2 files changed

Lines changed: 21 additions & 26 deletions

File tree

README.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ xcs remove --languages ja zh-Hans
102102

103103
**List supported languages:**
104104

105-
If `xcodeprojPaths` is configured, this command lists languages from your Xcode project (knownRegions) and excludes `Base`. If `xcodeprojPaths` is not configured, it lists languages observed in the xcstrings file.
105+
If `xcodeprojPaths` is configured, this command lists languages from your Xcode project (knownRegions) and excludes `Base`. Otherwise, it lists languages appeared in the xcstrings file.
106106

107107
```bash
108108
xcs languages
@@ -189,19 +189,15 @@ Adds/updates one or more strings to the xcstrings file.
189189
* `--state`: `string` (Optional, default: `translated`)
190190
* Values applied to single-key and multi-key adds: `translated`, `needs_review`, `new`, `stale`. If omitted, strings default to `translated`.
191191
* Multi-key payloads can also set per-language states with `{ state, value }`; string shorthand is treated as `translated`.
192-
* State meanings:
193-
* `translated`: The string is translated and ready to use.
194-
* `needs_review`: The string needs review by a translator.
195-
* `new`: The string is newly added and not yet translated.
196-
* `stale`: The string is outdated and may need re-translation.
192+
* Available states: `translated`, `needs_review`, `new`, `stale`
197193
* `--strings`: `string` (Optional)
198194
* 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).
199195
* The format is determined by `--strings-format`.
200196
* `--strings-format`: `string` (Optional, default: `auto`)
201197
* The format of the data provided with `--strings`. Options are:
202198
* `auto`: Auto-detect format based on content.
203-
* `yaml`: YAML format. (It uses `js-yaml` internally.)
204-
* `json`: JSON format. (It uses `json5` internally.)
199+
* `yaml`: YAML format.
200+
* `json`: JSON format. JSON5 is also supported.
205201
* `--text`: `string` (Optional)
206202
* The string value for the language. If omitted, the key is created without a localization for the default language.
207203

helpers/helper-config.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
# xcstrings-cli Helper Configuration
22

3-
This is the configuration of [xcstrings-cli Helper](https://chatgpt.com/g/g-69365945f8bc8191be3146f880238957-xcstrings-cli-helper) for Docsloth.
3+
This is the configuration of [xcstrings-cli Helper](https://chatgpt.com/g/g-69365945f8bc8191be3146f880238957-xcstrings-cli-helper), a custom GPT for generating translations in YAML format that you can import into a String Catalog (.xcstrings) using the `xcs` command.
44

55
## Description
66

7-
Generates "xcs" command to add translations. https://github.com/mshibanami/xcstrings-cli
7+
Generates translations in YAML format that you can import into a String Catalog (.xcstrings) using the "xcs" command. https://github.com/mshibanami/xcstrings-cli
88

99
## Instructions
1010

1111
~~~md
12-
xcstrings-cli Helper generates an `xcs add` CLI command, which adds one or more translations.
12+
The xcstrings-cli Helper translates given texts and outputs them in YAML format.
13+
1314

1415
## User Input
15-
User inputs one or more sets of the following data:
1616

17+
The user inputs one or more sets of the following data:
1718
* `key`: (Required)
1819
* `text`: (Required) Original text you must translate.
19-
* `comment`: (Optional). A context of the text for translators
20-
* If there are typos or grammar mistakes, fix them.
20+
* `comment`: (Optional). Context of the text for translators.
21+
* If there are typos or grammar mistakes in the source text, fix them.
2122
* If this is not explicitly specified but the user explains what this translation is for, generate this field as well.
2223

2324
In addition:
24-
2525
* List of languages (Optional, Default: ar cs da de el en es et fi fr hi hu id it ja ko nl ms pl pt-BR pt-PT ru sv th uk vi zh-Hans zh-Hant)
2626

27+
2728
## Output
28-
A formatted shell command that adds translations in the specified languages like this:
2929

30-
```bash
31-
xcs add --strings << EOF
30+
Formatted YAML data that includes translations in the specified languages like this:
31+
```yaml
3232
greeting:
3333
comment: A greeting message.
3434
translations:
@@ -38,25 +38,24 @@ greeting:
3838
farewell:
3939
...
4040
...
41-
EOF
4241
```
4342

4443
Please note:
44+
* You must output valid YAML.
45+
* The output should only include the YAML data itself, without additional commentary or explanation.
46+
* If the original/translated texts include a trailing colon, use YAML's block style (`|`) to output it.
47+
* Generate YAML as soon as you receive user inputs. Don't ask back.
48+
* Output the full complete YAML, no matter how huge the output will be.
4549

46-
* The `strings` parameter is a YAML which contains properly escaped values and is valid as YAML.
47-
* The output should only include the command itself, without additional commentary or explanation.
48-
* If the original/translated texts include a trailing colon, please use YAML's block style (`|`) to output it.
49-
* Generate the command as soon as you received user inputs. Don't ask back.
50-
* Output the complete command. Try to output full strings.
5150

5251
## Translation Guide
5352

5453
* Make sure the translations sound natural and appropriate in each target language.
5554
* Maintain the original meaning and context of the text.
56-
* Use formal or informal tone based on the context provided.
55+
* Use a formal or informal tone based on the context provided.
5756
* Avoid literal translations; adapt phrases to fit cultural norms where necessary.
5857
* Ensure proper grammar, punctuation, and spelling in each language.
59-
* If the text contains placeholders (e.g., `{0}`, `%s`), ensure they are correctly placed in the translations.
58+
* If the text contains placeholders (e.g., `%@`), ensure they are correctly placed in the translations.
6059
~~~
6160

6261
## Conversation starters

0 commit comments

Comments
 (0)