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 tooltip text to Polygon3DEditor buttons #102760

Merged
merged 1 commit into from
Feb 12, 2025

Conversation

Giganzo
Copy link
Contributor

@Giganzo Giganzo commented Feb 12, 2025

Fixes: #102759

After

Screencast_20250210_052335.webm

@akien-mga akien-mga added this to the 4.4 milestone Feb 12, 2025
@@ -535,12 +535,14 @@ Polygon3DEditor::Polygon3DEditor() {

button_create = memnew(Button);
button_create->set_theme_type_variation(SceneStringName(FlatButton));
button_create->set_tooltip_text(TTR("Create Polygon"));
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
button_create->set_tooltip_text(TTR("Create Polygon"));
button_create->set_tooltip_text(TTRC("Create Polygon"));

Copy link
Contributor

@Ivorforce Ivorforce Feb 12, 2025

Choose a reason for hiding this comment

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

TTR is correct. TTRC is for static C string literals, to mark them that they will later be translated, and does not actually translate the string.

Copy link
Contributor

@arkology arkology Feb 12, 2025

Choose a reason for hiding this comment

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

And this prevents double translation. See #99158 (or, for example, #101427 (comment)).

Copy link
Contributor

@Ivorforce Ivorforce Feb 12, 2025

Choose a reason for hiding this comment

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

Ok, I did check set_tooltip_text's implementation before commenting, which appeared not to translate. But it appears it does propagate tooltip_auto_translate_mode into Node::set_auto_translate_mode which does schedule translations (if auto). set_tooltip_text is used with TTRC sometimes (though TTR is used most times), so it's probably OK to change to TTRC.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the suggested changes to use TTRC instead of TTR.

@Giganzo Giganzo force-pushed the csg-toolbar-tooltips branch from 320c587 to 030d63e Compare February 12, 2025 17:42
@Repiteo Repiteo merged commit 9ad7f55 into godotengine:master Feb 12, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Feb 12, 2025

Thanks!

@Giganzo Giganzo deleted the csg-toolbar-tooltips branch February 16, 2025 10:29
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.

CSGPolygon3D toolbar buttons has no tooltips
6 participants