godot-docs-l10n
godot-docs-l10n copied to clipboard
help
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) `