-
-
Notifications
You must be signed in to change notification settings - Fork 22k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable changing editor language without restart #102562
Conversation
11ee6b9
to
4aca348
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should also remove this editor hint check in SceneTree
. So that NOTIFICATION_TRANSLATION_CHANGED
can propagate.
godot/scene/main/scene_tree.cpp
Lines 772 to 775 in cae3d72
case NOTIFICATION_TRANSLATION_CHANGED: { | |
if (!Engine::get_singleton()->is_editor_hint()) { | |
get_root()->propagate_notification(p_notification); | |
} |
4aca348
to
68d9833
Compare
Removed. |
Thanks! |
Most likely some of the direction dependent editor icons aren't reloaded when direction changes, I'll check it later. |
Currently changing editor language requires editor restart. Godot has a good auto-translation system, which is under-utilized in the editor. For a long time the editor auto-translation was completely disabled. Then there is TTR method which we use everywhere, which makes it impossible to auto-translate, because it immediately translates the string.
#75012 enabled auto-translation to work in the editor, and recently there were some efforts to replace TTR with TTRC (e.g. #99158). Also in 4.4 there were various GUI enhancements that added better localization support to many Control nodes.
This PR makes another step - it actually enables language switching in the editor.
godot.windows.editor.dev.x86_64_U2VP5Pd26j.mp4
Though as you can see, it's very basic right now. For proper language switching we need to use TTRC where possible, and NOTIFICATION_TRANSLATION_CHANGED where not (e.g. in format strings). Thus, while the PR makes changing the language setting have immediate effect, the user is still prompted to restart the editor as before.
IMO enabling this before the editor is ready is harmless, while it allows for easier testing of auto-translation. Eventually we will be able to properly switch editor language without restart at all.
Included some extra changes to the top menu bar, to make it more obvious that the language has changed.