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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable automatic translation of context menus in TextEdit, LineEdit, and RichTextLabel #97246

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

scgm0
Copy link
Contributor

@scgm0 scgm0 commented Sep 20, 2024

Set automatic translation of context menus in TextEdit, LineEdit and RichTextLabel to Always to avoid having to use additional script code to enable automatic translation when localizing context menu content.

@scgm0 scgm0 requested a review from a team as a code owner September 20, 2024 19:02
@AThousandShips AThousandShips changed the title Automatic translation of context menus Enable automatic translation of context menus Sep 20, 2024
@AThousandShips AThousandShips changed the title Enable automatic translation of context menus Enable automatic translation of context menus in TextEdit, LineEdit, and RichTextLabel Sep 20, 2024
@AThousandShips AThousandShips added this to the 4.x milestone Sep 20, 2024
@KoBeWi
Copy link
Member

KoBeWi commented Sep 20, 2024

The default is INHERIT though, so they should be translated if the base node is translated.

@scgm0
Copy link
Contributor Author

scgm0 commented Sep 20, 2024

The default is INHERIT though, so they should be translated if the base node is translated.

But it's rare that their parent nodes will have auto-translation enabled, which should be the case for TextEdit and LineEdit, and in one case the context menu for TextEdit in Tree, which strikes me as odd.
图片

@KoBeWi
Copy link
Member

KoBeWi commented Sep 20, 2024

But LineEdit/TextEdit also use INHERIT mode, which means they are auto-translated by default. It does not affect their written text, only placeholders, so I don't see why they would have translation disabled.

@timothyqiu
Copy link
Member

in one case the context menu for TextEdit in Tree, which strikes me as odd.

To solve your problem, I think it's enough to add a get_text_edit() method to Tree, like how we expose the LineEdit in SpinBox.

For auto translation mode, I agree with @KoBeWi that the context menu should stay the same as its parent by default.

See also godotengine/godot-proposals#9938 for a slightly more systematic approach that adds an auto translate mode that only translate internal nodes.

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.

4 participants