godot-docs-l10n icon indicating copy to clipboard operation
godot-docs-l10n copied to clipboard

help

Open anewlearner256 opened this issue 1 year ago • 0 comments

I have converted the .po to a .mo file, and then translated the .rst file through the following code, but the result is not translated, what is the reason? The following is the code converted by python: `import gettext import os

localedir = os.path.abspath("E:\worksp\Godot3.4\godot-docs\po\zh-CN") lang = 'zh_CN' _ = gettext.translation('godot-engine-godot-docs-zh_Hans', localedir, languages=[lang], fallback=False).gettext

with open("E:\worksp\Godot3.4\godot-docs\test.rst", 'r', encoding='utf-8') as rst_file: str_to_translate = _(rst_file.read())

translated_content = _(str_to_translate) print(translated_content) `

anewlearner256 avatar Dec 21 '23 05:12 anewlearner256