gpt-po 1.0.3 → 1.0.4
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 +4 -0
- package/README_zh-CN.md +5 -1
- package/lib/package.json +1 -1
- package/lib/src/utils.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# PO File Translation Tool for ChatGPT
|
2
2
|
|
3
|
+
[](https://npmjs.org/package/gpt-po)
|
4
|
+
[](https://npmjs.org/package/gpt-po)
|
5
|
+
|
3
6
|
Translation tool for gettext (po) files that supports custom system prompts and user dictionaries. It also supports translating specified po files to a designated target language and updating po files based on pot files.
|
4
7
|
|
5
8
|
Read in other languages: English | [简体中文](./README_zh-CN.md)
|
@@ -49,6 +52,7 @@ Options:
|
|
49
52
|
--model <model> openai model (choices: "gpt-4", "gpt-4-0314", "gpt-4-32k", "gpt-4-32k-0314", "gpt-3.5-turbo", "gpt-3.5-turbo-0301",
|
50
53
|
default: "gpt-3.5-turbo")
|
51
54
|
--po <file> po file path
|
55
|
+
-src, --source <lang> source language (default: "english")
|
52
56
|
-l, --lang <lang> target language (default: "simplified chinese")
|
53
57
|
-o, --output <file> output file path, overwirte po file by default
|
54
58
|
-h, --help display help for command
|
package/README_zh-CN.md
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
# PO文件CHATGPT翻译工具
|
2
2
|
|
3
|
+
[](https://npmjs.org/package/gpt-po)
|
4
|
+
[](https://npmjs.org/package/gpt-po)
|
5
|
+
|
3
6
|
gettext(po)文件翻译工具,支持自定义系统提示词和用户字典,支持翻译指定的po文件到指定的目标语言,支持根据pot文件更新po文件。
|
4
7
|
|
5
|
-
使用其他语言阅读:[English](./
|
8
|
+
使用其他语言阅读:[English](./README.md) | 简体中文
|
6
9
|
|
7
10
|
## 安装
|
8
11
|
|
@@ -49,6 +52,7 @@ Options:
|
|
49
52
|
--model <model> openai model (choices: "gpt-4", "gpt-4-0314", "gpt-4-32k", "gpt-4-32k-0314", "gpt-3.5-turbo", "gpt-3.5-turbo-0301",
|
50
53
|
default: "gpt-3.5-turbo")
|
51
54
|
--po <file> po file path
|
55
|
+
-src, --source <lang> source language (default: "english")
|
52
56
|
-l, --lang <lang> target language (default: "simplified chinese")
|
53
57
|
-o, --output <file> output file path, overwirte po file by default
|
54
58
|
-h, --help display help for command
|
package/lib/package.json
CHANGED
package/lib/src/utils.js
CHANGED
@@ -36,7 +36,7 @@ function parsePo(poFile, defaultCharset) {
|
|
36
36
|
}
|
37
37
|
exports.parsePo = parsePo;
|
38
38
|
function compilePo(data, poFile) {
|
39
|
-
const buffer = gettext_parser_1.po.compile(data);
|
39
|
+
const buffer = gettext_parser_1.po.compile(data, { foldLength: 120 });
|
40
40
|
return new Promise((resolve, reject) => {
|
41
41
|
fs.writeFile(poFile, buffer, (err) => {
|
42
42
|
if (err)
|