godotengine / godotengine/godot-docs

Expand the tutorial about translation template generation

Open
#12,219 0 comments 2 reactions 0 assignees View on GitHub
area:manual enhancement topic:i18n
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**

4.8 dev

**Issue description:**

The POT generator was recently expanded and, now called "Template generator", allows creating CSV templates too. However the only mention of the generator is still in the gettext tutorial.

It likely deserves its own page, and can be expanded with extra information, like best practices or tricks how to prepare scenes/script for extracting.

Things that could be added:
- List of some example fields that get extracted from scenes (like any `text` property etc.)
- I wouldn't make full list though, or at least clearly state that it's not exhaustive, to avoid needing to update it.
- Node's `auto_translate_mode` affects which strings are extracted.
- Control's new `translation_context` property is included in the template.
- This is a trick, but if you want to mark an arbitrary string in script for translation, without translating it, you can use `set_message_translation()` to disable translation of an object and then call `tr()` on that object, to obtain an extractable, but not translated string.
- The EditorTranslationParserPlugin's new `_customize_strings()` method allows to add/remove/modify extracted strings, which can be useful for some advanced operations.
- One example is when you have a placeholder string in a scene that you don't want to translate, but the node with the string should not have translation disabled. You can prefix such strings with a fixed prefix, to easily filter it out. This is yet another trick I guess.
- Template generator can be invoked from Command Palette, which is useful when you are actively working on updating the template.

**URL to the documentation page:**

https://docs.godotengine.org/en/latest/tutorials/i18n/localization_using_gettext.html#automatic-generation-using-the-editor

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the “Automatic generation using the Editor” section at the linked gettext documentation page and review how the current Template generator is described. Create or expand documentation to explain its CSV support, extracted scene and script strings, relevant translation properties, parser customization, and Command Palette access. Done means the generator has a clear standalone treatment with the listed practical guidance.

Written by the indexing model from the issue text.

Assessment

Tech stack
godot
Domain
documentation, internationalization
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.