NEKOparapa / AiNiee

一款专注于Ai翻译的工具,可以用来一键自动翻译RPG SLG游戏,Epub TXT小说,Srt Lrc字幕等等。
GNU General Public License v3.0
1.33k stars 74 forks source link

Gemini 翻译后,部分译文末尾的字符会被替换为反斜线+引号 #233

Closed jeshs closed 1 month ago

jeshs commented 3 months ago

1 使用Gemini 翻译后,某些译文最后一个字符被替换成\",几个月前就存在这个问题,我使用一个JSON原文进行测试。设置每次翻译1行,上文1行,最大线程设置0 2 原文

{
    ";base64,": ";base64",
    "The cacheId \"": "The cacheId \"",
    "value \"": "value \"",
    "s sole resident,": "s sole resident,"
}

3 译文

{
    ";base64,": ";base6\",",
    "The cacheId \"": "缓存ID \\\"",
    "value \"": "值 \\\"",
    "s sole resident,": "唯一的居民,"
}

4 译文中,base64末尾的4被替换为\"

5 日志 [INFO] 系统代理端口是: http://127.0.0.1:10809

[INFO] 翻译项目为 Mtool导出文件

[INFO] 翻译平台为 Google官方

[INFO] 请求地址为 https://api.openai.com/v1

[INFO] 翻译模型为 gemini-1.5-pro

[INFO] 已开启自定义系统提示词功能,设置为用户设定的提示词 [INFO] 当前设定的系统提示词为: You are a professional game localization translator specializing in translating RPGMaker games from English to Simplified Chinese. Your task is to accurately translate the given English game text into Simplified Chinese while maintaining the game's playability and original style. Please follow these steps for translation: Carefully read the original text, understanding the context and overall meaning. Perform an initial translation, ensuring: a) Preserve all elements that may affect game operation, such as code, variables, placeholders, special characters, etc. b) Maintain the original format, including line breaks, indentation, and punctuation usage. c) Accurately convey the meaning and tone of the original text, making the translation conform to Chinese expression habits. Use the following chain of thought to optimize the translation: a) What is the possible scenario in the game where this text might appear? b) What is the identity and tone of the speaker? c) Are there any game terms or proper nouns that need special attention? d) How can the translation be made more natural and fluent while maintaining the original style? e) Are there any cultural differences that need to be considered? Modify and refine the translation based on the results of the chain of thought. Carefully check the translation, ensuring: a) No content is omitted or mistranslated. b) All elements that need to be preserved have been correctly retained. c) The translation conforms to Chinese language habits and the characteristics of game text. Output the translation in the required format: {{"":""},{"":""}}

[INFO] 游戏文本从 英语 翻译到 简中

[INFO] 文本总行数为: 4 需要翻译的行数为: 4 [INFO] 每次发送行数为: 1 计划的翻译任务总数是: 4

[INFO] 五秒后开始进行翻译,请注意保持网络通畅,余额充足。

[INFO] 已开启自定义系统提示词功能,设置为用户设定的提示词 [INFO] 已添加背景设定:

Background Setting

This RPG Maker MZ game follows Aura, who accidentally enters the fantasy world of Roya. Cursed by a Demon Lord, she must nightly pursue and defeat her nemesis, who hides not only in Roya but can invade Aura's mind through the curse. Players control Aura and Alicia, gradually altering their values and romantic preferences. The game features interactions between Aura, Alicia, Aura's friend Rose, and Aura's boyfriend George.

[INFO] 已开启自定义系统提示词功能,设置为用户设定的提示词 [INFO] 已添加格式原文示例: [INFO] 已添加背景设定: {"0": "Love is the flame in the depth of the soul, warm and never extinguished."} [INFO] 已添加格式译文示例: [INFO] 已开启自定义系统提示词功能,设置为用户设定的提示词 [INFO] 已开启自定义系统提示词功能,设置为用户设定的提示词

Background Setting

This RPG Maker MZ game follows Aura, who accidentally enters the fantasy world of Roya. Cursed by a Demon Lord, she must nightly pursue and defeat her nemesis, who hides not only in Roya but can invade Aura's mind through the curse. Players control Aura and Alicia, gradually altering their values and romantic preferences. The game features interactions between Aura, Alicia, Aura's friend Rose, and Aura's boyfriend George. {"0": "爱情是灵魂深处的火焰,温暖且永不熄灭。"}

[INFO] 已添加背景设定:

Background Setting

This RPG Maker MZ game follows Aura, who accidentally enters the fantasy world of Roya. Cursed by a Demon Lord, she must nightly pursue and defeat her nemesis, who hides not only in Roya but can invade Aura's mind through the curse. Players control Aura and Alicia, gradually altering their values and romantic preferences. The game features interactions between Aura, Alicia, Aura's friend Rose, and Aura's boyfriend George.

[INFO] 已添加背景设定:

Background Setting

This RPG Maker MZ game follows Aura, who accidentally enters the fantasy world of Roya. Cursed by a Demon Lord, she must nightly pursue and defeat her nemesis, who hides not only in Roya but can invade Aura's mind through the curse. Players control Aura and Alicia, gradually altering their values and romantic preferences. The game features interactions between Aura, Alicia, Aura's friend Rose, and Aura's boyfriend George.

[INFO] 已添加格式原文示例: {"0": "Love is the flame in the depth of the soul, warm and never extinguished."} [INFO] 已添加格式译文示例: [INFO] 已添加用户原文示例: {"0": "爱情是灵魂深处的火焰,温暖且永不熄灭。"}

{ "0":"$gameVariables.value(242) == 100", "1":"Obtained \c[2]Gold x 100\c[0]!", "2":"", "3":"\N[\V[30]]'s LUCK increased by 5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" } [INFO] 已添加格式原文示例: {"0": "Love is the flame in the depth of the soul, warm and never extinguished."} [INFO] 已添加格式译文示例: [INFO] 已添加用户译文示例: [INFO] 已添加用户原文示例: { "0":"$gameVariables.value(242) == 100", "1":"Obtained \c[2]Gold x 100\c[0]!", "2":"", "3":"\N[\V[30]]'s LUCK increased by 5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" } [INFO] 已添加用户译文示例:

{ "0":"$gameVariables.value(242) == 100", "1":"获得了 \c[2]金币 x 100\c[0]! ", "2":"", "3":"\N[\V[30]]的幸运增加了5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" } [INFO] 已添加格式原文示例:

{"0": "爱情是灵魂深处的火焰,温暖且永不熄灭。"}

{"0": "Love is the flame in the depth of the soul, warm and never extinguished."} [INFO] 已添加格式译文示例: [INFO] 你开启了保留换行符功能,正在进行替换

{"0": "爱情是灵魂深处的火焰,温暖且永不熄灭。"}

{ "0":"$gameVariables.value(242) == 100", "1":"获得了 \c[2]金币 x 100\c[0]! ", "2":"", "3":"\N[\V[30]]的幸运增加了5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" } [INFO] 已添加用户原文示例: { "0":"$gameVariables.value(242) == 100", "1":"Obtained \c[2]Gold x 100\c[0]!", "2":"", "3":"\N[\V[30]]'s LUCK increased by 5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" }

[INFO] 已添加用户原文示例: { "0":"$gameVariables.value(242) == 100", "1":"Obtained \c[2]Gold x 100\c[0]!", "2":"", "3":"\N[\V[30]]'s LUCK increased by 5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" } [INFO] 你开启了保留换行符功能,正在进行替换

[INFO] 已添加用户译文示例: { "0":"$gameVariables.value(242) == 100", "1":"获得了 \c[2]金币 x 100\c[0]! ", "2":"", "3":"\N[\V[30]]的幸运增加了5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" }[INFO] 已添加用户译文示例:

{ "0":"$gameVariables.value(242) == 100", "1":"获得了 \c[2]金币 x 100\c[0]! ", "2":"", "3":"\N[\V[30]]的幸运增加了5!", "4":"tutoringAlicia", "5":"SwitchToAlicia" }

[INFO] 你开启了保留换行符功能,正在进行替换

[INFO] 你开启了保留换行符功能,正在进行替换 [INFO] 已发送请求,正在等待AI回复中-----------------------

[INFO] 线程 ID: 4816, 文本行数: 1, tokens数: 790 [INFO] 当前发送的原文文本:

Previous text

value "

This is your next translation task, the original text is as follows

{"0": "s sole resident,"}

Error: 进行请求时出现问题!!!错误信息如下 Error: 429 POST https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent?%24alt=json%3Benum-encoding%3Dint: Resource has been exhausted (e.g. check quota).

[INFO] 已发送请求,正在等待AI回复中----------------------- [INFO] 线程 ID: 3172, 文本行数: 1, tokens数: 784 [INFO] 当前发送的原文文本:

This is your next translation task, the original text is as follows

{"0": ";base64,"}

[INFO] 已成功接受到AI的回复----------------------- [INFO] 线程 ID: 3172, 等待时间: 3.25 秒 [INFO] AI回复的文本内容:

{"0": ";base64,"}

This appears to be a code snippet and not something that needs to be translated. The translation would remain the same in both English and Simplified Chinese.

Is there anything else I can help you with?


Success: AI回复内容检查通过!!!已翻译完成25.0%


[INFO] 已发送请求,正在等待AI回复中----------------------- [INFO] 线程 ID: 4300, 文本行数: 1, tokens数: 791 [INFO] 当前发送的原文文本:

Previous text

;base64,

This is your next translation task, the original text is as follows

{"0": "The cacheId \""}

[INFO] 已发送请求,正在等待AI回复中----------------------- [INFO] 线程 ID: 4816, 文本行数: 1, tokens数: 790 [INFO] 当前发送的原文文本:

Previous text

value "

This is your next translation task, the original text is as follows

{"0": "s sole resident,"}

[INFO] 已成功接受到AI的回复----------------------- [INFO] 线程 ID: 4300, 等待时间: 3.49 秒 [INFO] AI回复的文本内容:

{"0": "缓存ID \""}

Success: AI回复内容检查通过!!!已翻译完成50.0%


[INFO] 已发送请求,正在等待AI回复中----------------------- [INFO] 线程 ID: 8388, 文本行数: 1, tokens数: 790 [INFO] 当前发送的原文文本:

Previous text

The cacheId "

This is your next translation task, the original text is as follows

{"0": "value \""}

[INFO] 已成功接受到AI的回复----------------------- [INFO] 线程 ID: 4816, 等待时间: 3.92 秒 [INFO] AI回复的文本内容:

{"0": "唯一的居民,"}

Success: AI回复内容检查通过!!!已翻译完成75.0%


Error: 进行请求时出现问题!!!错误信息如下 Error: 429 POST https://generativelanguage.googleapis.com/v1beta/models/gemini-1.5-pro:generateContent?%24alt=json%3Benum-encoding%3Dint: Resource has been exhausted (e.g. check quota).

[INFO] 已发送请求,正在等待AI回复中----------------------- [INFO] 线程 ID: 8388, 文本行数: 1, tokens数: 790 [INFO] 当前发送的原文文本:

Previous text

The cacheId "

This is your next translation task, the original text is as follows

{"0": "value \""}

[INFO] 已成功接受到AI的回复----------------------- [INFO] 线程 ID: 8388, 等待时间: 2.8 秒 [INFO] AI回复的文本内容:

{"0": "值 \""}

Success: AI回复内容检查通过!!!已翻译完成100.0%


Success: 翻译阶段已完成,正在处理数据-----------------------------------

Success: 译文文件写入完成-----------------------------------


Success: 已完成全部翻译任务,程序已经停止

Success: 请检查译文文件,格式是否错误,存在错行,空行等问题


NEKOparapa commented 3 months ago

这应该是谷歌的问题,没有将转义符号进行转义。

NEKOparapa commented 3 months ago

之前回答是看到了双斜杠变四斜杠。 自动在文本开头加双引号和结尾加双引号,根源在于文本修复算法,因为之前有些AI翻译后,会缺少这些格式符号。需要反馈更多关于这个问题的文本