+3 votes

Is it possible to display translations inside the editor?
Right now it seems they are displayed only when running the game.

in Engine by (254 points)

It would also be very useful to display translations inside the inspector.

1 Answer

+2 votes
Best answer

After looking into this, I found that the TranslationServer (as of now) seems to be always disabled in the editor.

This is because in editor_node.cpp there is a call: TranslationServer::get_singleton()->set_enabled(false)

After commenting that out and rebuilding Godot I am now able to see translations. I'm not sure why it has to be disabled in the editor though.

UPDATE: I found out that Label's set_text method instead of storing the key will store the translation. This means with the above modification, Labels will lose the correct key value in their text property and change it into the translated value. This is why the TranslationServer is disabled in the editor. The better solution though would be to have Label store the key and only translate when rendering (or possibly have a local cache of the translation)

by (254 points)
edited by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.