Tested versions
4.5 after 68d9833
System information
W10
Issue description
With #102562 merged, we can now change editor's language without restarting. However the option is still marked as requiring restart, because it's not complete. The editor needs to properly utilize Godot's auto-translation system to allow full language switching. There is lots of legacy code that prevents that, with the main culprit being TTR method that translates strings in place, thus preventing auto-translation to occur.
Here are some guidelines that should be used from now on, and applied to old code, to have proper auto-translation in the editor:
- For static translateable strings, i.e. Labels that are assigned once etc., TTRC should be used.
- For dynamic translateable strings, TTR should be used with combination of vformat (e.g.
vformat(TTR("%d times greater"), times)).
- If the strings are being re-created every time they display, e.g. in context menus that are usually cleared on each popup, nothing more needs to be done.
- For strings that don't update every time they are shown, NOTIFIACTION_TRANSLATION_CHANGED should be used. I don't think we are doing that already somewhere, so this needs to be established.
You can use the above guidelines to find code that needs to be updated, if it doesn't follow them. Alternatively you can open editor, change language and look for strings that didn't change (best tested with translations that have high completion percentage, as some texts won't translate otherwise). Feel free to open pull requests referencing this issue.
I'm opening this issue as a pseudo-tracker. I don't know every area that needs changes, but the issue is going to be open until there is no more strings that need updating.
Steps to reproduce
- Open editor with non-English language
- Change language
- Look for text that still uses previous language
Minimal reproduction project (MRP)
N/A
Tested versions
4.5 after 68d9833
System information
W10
Issue description
With #102562 merged, we can now change editor's language without restarting. However the option is still marked as requiring restart, because it's not complete. The editor needs to properly utilize Godot's auto-translation system to allow full language switching. There is lots of legacy code that prevents that, with the main culprit being TTR method that translates strings in place, thus preventing auto-translation to occur.
Here are some guidelines that should be used from now on, and applied to old code, to have proper auto-translation in the editor:
vformat(TTR("%d times greater"), times)).You can use the above guidelines to find code that needs to be updated, if it doesn't follow them. Alternatively you can open editor, change language and look for strings that didn't change (best tested with translations that have high completion percentage, as some texts won't translate otherwise). Feel free to open pull requests referencing this issue.
I'm opening this issue as a pseudo-tracker. I don't know every area that needs changes, but the issue is going to be open until there is no more strings that need updating.
Steps to reproduce
Minimal reproduction project (MRP)
N/A