Make `Label3D` obey auto translation

This commit is contained in:
Michael Alexsander 2024-03-01 14:03:18 -03:00
parent dad6c774b0
commit 55b22c2bf6
No known key found for this signature in database
GPG Key ID: A9C91EE110F4EABA
2 changed files with 3 additions and 2 deletions

View File

@ -53,6 +53,7 @@
</member>
<member name="text" type="String" setter="set_text" getter="get_text" default="&quot;&quot;">
The text to generate mesh from.
[b]Note:[/b] Due to being a [Resource], it doesn't follow the rules of [member Node.auto_translate_mode]. If disabling translation is desired, it should be done manually with [method Object.set_message_translation].
</member>
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="TextServer.Direction" default="0">
Base text writing direction.

View File

@ -208,7 +208,7 @@ void Label3D::_notification(int p_what) {
viewport->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
} break;
case NOTIFICATION_TRANSLATION_CHANGED: {
String new_text = tr(text);
String new_text = atr(text);
if (new_text == xl_text) {
return; // Nothing new.
}
@ -636,7 +636,7 @@ void Label3D::_shape() {
void Label3D::set_text(const String &p_string) {
text = p_string;
xl_text = tr(p_string);
xl_text = atr(p_string);
dirty_text = true;
_queue_update();
}