-
-
Notifications
You must be signed in to change notification settings - Fork 21k
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
i18n: Expose editor's translation via EditorInterface
.
#82158
Conversation
Related: #77104 |
One thing I think #77104 does better is that it keeps track of what messages are actually added. This makes it easy to perform inverse operations. Exposing |
I think plugin developers should handle conflicts and removals themselves. They will find and resolve translation conflicts when debugging their plugins. For removal, it's also easy. Continuing with the example above: func unload_translation():
if translation:
for msg in translation.get_message_list():
tool_translation.erase_message(msg)
translation = null |
Editor translation changes. Entries from other plugins would also collide with your plugin. |
This can also be handled manually: # ...
for msg in translation.get_message_list():
if tool_translation.get_message(msg) != "":
push_warning("Translation conflict for '%s'! Please report to the author!" % msg)
translation.erase_message(msg) # avoid removal on unloading
else:
tool_translation.add_message(msg, translation.get_message(msg)) I think we can document it to guide developers on how to support i18n for their plugins. |
Superseded by #95787. |
Closes godotengine/godot-proposals#6885
Closes godotengine/godot-proposals#1262
Expose editor's translation via
EditorInterface.get_editor_translation()
. This will allow developers to add translations for their plugin.Example (Updated):
tr_test.zip