anonymousException / renpy-translator

A translator for renpy based on google | youdao | deepl | open-ai | offline-ai tranlation supports extract untranslated words and translate
MIT License
101 stars 12 forks source link

关于“renpy_translate.py”第264行判断自动跳过除第一行以外所有文本问题 #1

Closed vkxuds closed 8 months ago

vkxuds commented 8 months ago

renpy_translate.py中TranslateFile函数读取源文本内容时,判断语句会自动跳过大部分语句,最终全部跳过

e48acf95801d6b538285f7b862d2a23

我目前是直接修改代码后让其能替换原rpy文件,然后把游戏默认语言设定为中文使用,没问题

vkxuds commented 8 months ago

顺便一提,于228行处“client = Translate()”可以在括号内添加本地vpn端口,科学上网后就能使用,不需要扫描端口等等,例如“client = Translate(proxies={'https': 'http://localhost:7890'})”

anonymousException commented 8 months ago
  1. TranslateFile 不支持直接读取源文本,需要经过抽取(extract)处理过的文本才能够 TranslateFile 翻译,因为翻译的目标格式就应该是 tl 目录底下的文件
  2. 支持代理会考虑后续加到功能里(而且不是所有人都会科学上网)
vkxuds commented 8 months ago
  1. TranslateFile 不支持直接读取源文本,需要经过抽取(extract)处理过的文本才能够 TranslateFile 翻译,因为翻译的目标格式就应该是 tl 目录底下的文件

抱歉,我说错了,不是源文本,是生成翻译文件后的待填写.rpy文件读取全部跳过了,第二点是因为我扫描替换hosts后没有效果,也可能是我的问题

anonymousException commented 8 months ago

待翻译的 .rpy 文件格式是否正确 (可以带上附件吗) 替换 hosts 取决于各地运营商的网络环境,不一定可行

vkxuds commented 8 months ago

script.TXT 不能上传rpy文件,请修改下格式,这个是demogame里面的,renpy生成翻译后输出的文件

anonymousException commented 8 months ago

文件格式不对,我文档里有写,使用 renpy 引擎生成翻译文本的时候不能勾选 "为翻译生成空字串" 因为翻译时翻译的是注释后的 ”“ 或者 old "" 后面的 new "" ,并且会对比原文和要翻译的文本是否一致,不一致则认为是已翻译过的文本,不会再去翻译

vkxuds commented 8 months ago

抱歉!我的问题,刚接触renpy不久,细节没注意到,感谢解答

anonymousException commented 8 months ago

没有其它问题的话就把 issue 关闭了?

anonymousException commented 8 months ago

顺便一提,于228行处“client = Translate()”可以在括号内添加本地vpn端口,科学上网后就能使用,不需要扫描端口等等,例如“client = Translate(proxies={'https': 'http://localhost:7890'})”%E2%80%9D)

本地代理功能已更新到 v1.3.0 请查收 @vkxuds