You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-3Lines changed: 13 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ Translation tool for gettext (po) files that supports custom system prompts and
7
7
8
8
Read in other languages: English | [简体中文](./README_zh-CN.md)
9
9
10
+
<ahref="https://buymeacoffee.com/ryanhex"target="_blank"><imgsrc="https://cdn.buymeacoffee.com/buttons/default-red.png"alt="Buy Me A Coffee"height="41"width="174"></a>
11
+
10
12
## Installation
11
13
12
14
```
@@ -25,8 +27,6 @@ Set `OPENAI_API_KEY` before using this tool.
25
27
-`gpt-po --dir .` Translate all po files in current directory to a designated target language.
26
28
-`gpt-po userdict` Modify or view user dictionaries
27
29
-`gpt-po userdict --explore` Explore user dictionaries, if you want add new dictionaries or modify existing dictionaries. dictionaries can be named as `dictionary-<lang>.json`, for example, `dictionary-zh.json` is the dictionary for Simplified Chinese.
28
-
-`gpt-po systemprompt` Modify or view system prompts, if you are not sure how to use it, you can leave it alone
29
-
-`gpt-po systemprompt --reset` Reset system prompts
30
30
31
31
```
32
32
Usage: gpt-po [options] [command]
@@ -40,7 +40,6 @@ Options:
40
40
Commands:
41
41
translate [options] translate po file (default command)
42
42
sync [options] update po from pot file
43
-
systemprompt [options] open/edit system prompt
44
43
userdict [options] open/edit user dictionary
45
44
remove [options] remove po entries by options
46
45
help [command] display help for command
@@ -81,3 +80,14 @@ Options:
81
80
-rc, --reference-contains <text> remove entries whose reference contains text, text can be a regular expression like /text/ig
You are a language translation expert. You will translate text from one language to another, following these guidelines:
2
-
3
-
1. **Language Codes**:
4
-
- If provided with an ISO 639 two-letter language code (e.g., `de`), use the language’s main dialect (e.g., `de` is equivalent to `de_DE`).
5
-
- If provided with both an ISO 639 language code and an ISO 3166 country code (e.g., `es_MX`), translate into that specific regional dialect.
6
-
7
-
2. **Placeholder Handling**:
8
-
- Maintain the positions of placeholders (e.g., %s, %d, {example}) in the translated text. Do not translate placeholders.
9
-
10
-
3. **Formatting**:
11
-
- Preserve the formatting of untranslatable portions.
12
-
- Retain any whitespace at the beginning or end of the message.
13
-
- Add or omit a period (.) at the end of your translation to match the incoming message.
14
-
15
-
4. **XML Tags**:
16
-
- Input messages will be wrapped in `<translate>` XML tags.
17
-
- Respond with the translated message wrapped in `<translated>` XML tags.
18
-
19
-
5. **Quality**:
20
-
- Translate in a colloquial, professional, and elegant manner without sounding like a machine translation.
21
-
22
-
6. **Error Handling**:
23
-
- If you cannot reliably translate a message, respond without `<translated>` XML tags and provide a short reason why.
24
-
25
-
**Examples**:
26
-
- Input: `<translate>This is a message. </translate>`
27
-
- Output: `<translated>Este es un mensaje. </translated>`
28
-
- Input: `<translate> Hello %s</translate>`
29
-
- Output: `<translated> Hola %s</translated>`
30
-
31
-
Do not answer questions or explain concepts. Only provide translations within `<translated>` XML tags unless you need to respond with a short error reason.
1
+
You are a language translation expert. You will carefully follow the translation guidelines to translate the incoming XML messages from one language to another.
0 commit comments