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

Add auto translate mode for cells in Tree #97353

Merged
merged 1 commit into from
Oct 1, 2024

Conversation

timothyqiu
Copy link
Member

@timothyqiu timothyqiu commented Sep 23, 2024

Make i18n for Tree easier if only some cells need auto translation.

Otherwise users have to either rebuild the entire tree when locale is changed, or manually keep track of those special TreeItems.

Peek 2024-09-23 15-42

Test project: tree-at.zip


A separate AutoTranslateMode is created because AUTO_TRANSLATE_MODE_INHERIT could mean "the same as its parent TreeItem. I don't see practical use of this behavior, but could be implemented in the future.

AUTO_TRANSLATE_MODE_INHERIT means "the same auto translate mode as the Tree".

Copy link
Member

@bruvzg bruvzg left a comment

Choose a reason for hiding this comment

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

This might just be an over-thinking. I'll change this to use Node::AutoTranslateMode if making AUTO_TRANSLATE_MODE_INHERIT mean "the same as Tree" is expected.

I would definitely use AUTO_TRANSLATE_MODE_INHERIT, a note in the set_auto_translate_mode description should be enough to clarify what it's doing.

@timothyqiu
Copy link
Member Author

Done. Changed to use Node::AutoTranslateMode, and AUTO_TRANSLATE_MODE_INHERIT means "the same as Tree".

Copy link
Member

@YeldhamDev YeldhamDev left a comment

Choose a reason for hiding this comment

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

LGTM.

@akien-mga akien-mga merged commit 97fa718 into godotengine:master Oct 1, 2024
19 checks passed
@akien-mga
Copy link
Member

Thanks!

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