Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃寧 Translation Support #118

Draft
wants to merge 5 commits into
base: godot-4.x
Choose a base branch
from

Conversation

mrfelipemartins
Copy link
Contributor

Description

Adding translation support to Pandora. The Script will get the editor's language and always fallback to English.

Addressed issues

Draft Tasks

  • Add POT template for translations
  • Map all translatable strings in Pandora
  • English (en)
  • German (de)
  • Brazilian Portuguese (pt_BR)
  • Spanish (es)
  • French (fr)

The languages listed above are languages I can speak and am able to quickly translate as soon as all strings are mapped. Once this is merged you can raise a PR to add your language if missing.

texture_picker.texture_changed.connect(_set_icon_path)
script_picker.script_path_changed.connect(_set_script_path)
id_generation_enabled.toggled.connect(_set_id_generation)
class_name_edit.text_changed.connect(_set_class_name)

func _translate():
icon_label.text = TranslationManager.translate("ui.property_editor.icon_label.text")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Godot 3 we could simply use the tr() function available in GDScript. Could we do that instead of this custom translation mamager? Godot 4 supports .pot files in the project settings.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a better look at this, I thought that was only applied to the project, not to addons.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I ran some tests here and as I suspected the TranslationServer is not available in the EditorPlugin so we can't inject POT files.

Some refs:
godotengine/godot-proposals#6885
godotengine/godot-proposals#1262

I actually took the idea of the custom tr manager from the reference you gave in #65:

https://github.com/nathanhoad/godot_dialogue_manager/blob/71c65332cc7b34eee9c517aaa36d645a79bfadb3/addons/dialogue_manager/constants.gd#L254

@pietru2004
Copy link

I just want to add here that godot seams to be partially auto translating some words...
I seen it translate property names inside of pandora UI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

馃寧 Translation Support
3 participants