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

Fix missing native file dialog title translation. #99223

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Nov 14, 2024

Fixes #99207

@bruvzg bruvzg added this to the 4.4 milestone Nov 14, 2024
@bruvzg bruvzg requested a review from a team as a code owner November 14, 2024 12:38
@@ -67,10 +67,11 @@ void FileDialog::_native_popup() {
} else if (access == ACCESS_USERDATA) {
root = OS::get_singleton()->get_user_data_dir();
}
String tr_title = atr(get_title());
Copy link
Member

@akien-mga akien-mga Nov 14, 2024

Choose a reason for hiding this comment

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

Apparently this shadows tr_title from Window.

Two things then:

  • This could likely use tr_title directly?
  • But to do it properly it would likely make sense to make tr_title private and add a getter like get_translated_title.

Or just make tr_title private and recompute it here. If it's not something we need often, it probably shouldn't spill out of Window internal usage.

Copy link
Member

Choose a reason for hiding this comment

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

If we do decide to add a getter, then this can be simplified too:

main/viewport.cpp
333:            TextLine title_text = TextLine(p_window->atr(p_window->get_title()), title_font, font_size);

Copy link
Member Author

Choose a reason for hiding this comment

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

Added get_translated_title.

@bruvzg bruvzg force-pushed the fd_title_transl branch 2 times, most recently from 75519d4 to 6f89ada Compare November 14, 2024 12:45
@bruvzg bruvzg requested a review from a team as a code owner November 14, 2024 12:45
@bruvzg bruvzg requested a review from a team as a code owner November 14, 2024 12:49
@Repiteo Repiteo merged commit 0cc1a21 into godotengine:master Nov 14, 2024
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Nov 14, 2024

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.

Native FileDialog does not translate its title
3 participants