Translation context for Labels, Buttons, Tooltips, etc #8061
Replies: 3 comments 2 replies
-
This should probably be a property on Control, similar to the Auto Translate property. |
Beta Was this translation helpful? Give feedback.
-
Before supporting automatic collection of localization resource from the UI system, you must first mark which properties on the UI node need to be collected. In addition, the contents of the |
Beta Was this translation helpful? Give feedback.
-
The problem I see is that translation context and translation comment should be text specific, not control specific. But the definition of "this control's text" varies. Some control might contain multiple text fields so a single translation context won't fit all needs. Not to mention controls like If taken tooltips into account, every control's translation context also needs to be doubled. So currently it's just easier to use I think injecting extra elements like translation context and comment into the auto translation system needs a more in-depth design. Or we can call auto translation system simple-usecase-only, only adding |
Beta Was this translation helpful? Give feedback.
-
As of now, Godot can generate .pot from scripts, resources, labels, buttons, etc. In scripts, Godot will collect translations from tr() and tr_n() functions, where user can provide optional 2rd (for tr) and 4th (for tr_n) string argument, which would end up as translation context hint in .pot file for string that need to be translated, like this:
Will become this in .pot file:
But it seems, there no such option for Labels, Buttons, Tooltips, etc, that user added via Text input. At least, after some documentation reading and going through Godot ui, I can't find this option there.
I think, it could be good idea to provide additional input field for Labels, Buttons, Tooltips, etc, that would be added as translation context to that text or tooltip:
Beta Was this translation helpful? Give feedback.
All reactions