From 55b22c2bf6a22755ad4a4e19ffa51f693c5702b7 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Fri, 1 Mar 2024 14:03:18 -0300 Subject: [PATCH] Make `Label3D` obey auto translation --- doc/classes/TextMesh.xml | 1 + scene/3d/label_3d.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/classes/TextMesh.xml b/doc/classes/TextMesh.xml index 00c6b0b1a8c..9e705311c56 100644 --- a/doc/classes/TextMesh.xml +++ b/doc/classes/TextMesh.xml @@ -53,6 +53,7 @@ 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]. Base text writing direction. diff --git a/scene/3d/label_3d.cpp b/scene/3d/label_3d.cpp index 3fb472335e4..718ddd49828 100644 --- a/scene/3d/label_3d.cpp +++ b/scene/3d/label_3d.cpp @@ -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(); }