Skip to content

Add a "Correct translation" menu item to EditorHelp#116352

Open
Rindbee wants to merge 1 commit intogodotengine:masterfrom
Rindbee:add-a_correct_translation-menu-item-to-EditorHelp
Open

Add a "Correct translation" menu item to EditorHelp#116352
Rindbee wants to merge 1 commit intogodotengine:masterfrom
Rindbee:add-a_correct_translation-menu-item-to-EditorHelp

Conversation

@Rindbee
Copy link
Contributor

@Rindbee Rindbee commented Feb 16, 2026

This menu item will search for the selected text on weblate to help users easily correct/improve the translation of class references.

Peek.2026-02-16.20-46.mp4

Note that the selected text does not contain bbcode. It's best to avoid searching for text that has been modified with bbcode.


Translation also requires user participation to improve it. Using it in combination with #116007 might make it easier to contribute translations.

@Rindbee Rindbee marked this pull request as ready for review February 16, 2026 12:48
@Rindbee Rindbee requested review from a team as code owners February 16, 2026 12:48
@AThousandShips AThousandShips added this to the 4.x milestone Feb 16, 2026
if (p_option == MENU_CORRECT_TRANSLATION) {
StringBuilder sb;
sb.append("https://hosted.weblate.org/translate/godot-engine/godot-class-reference/");
sb.append(TranslationServer::get_singleton()->get_locale());
Copy link
Member

Choose a reason for hiding this comment

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

Will this be affected by the editor language setting? I'm not familiar with the internals of the engine language setting and how it's used for that side

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the locale tag obtained here is consistent with that displayed by interface/editor/editor_language. Because the tag for Simplified Chinese is zh_Hans (not zh_CN) now.

Copy link
Member

Choose a reason for hiding this comment

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

And it's not based on the locale of the machine but instead on that setting?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When interface/editor/editor_language is set to auto, it is based on the locale of the machine.

Copy link
Member

Choose a reason for hiding this comment

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

TranslationServer::get_singleton() is current locale of editor (or running project), OS::get_locale() is locale of the system.

Copy link
Member

Choose a reason for hiding this comment

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

I think I'm not making myself clear:
If you set interface/editor/editor_language to something other than auto, does TranslationServer::get_singleton()->get_locale() return the assigned value in that property, or the locale?

This menu item will search for the selected text on weblate to help
users easily correct/improve the translation of class references.
@Rindbee Rindbee force-pushed the add-a_correct_translation-menu-item-to-EditorHelp branch from 936b9f6 to 0482677 Compare February 16, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants