Merge pull request #89056 from YeldhamDev/rotulo_tres_de
Make `Label3D` obey auto translation
This commit is contained in:
commit
8e6661cb48
@ -53,6 +53,7 @@
|
|||||||
</member>
|
</member>
|
||||||
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
<member name="text" type="String" setter="set_text" getter="get_text" default="""">
|
||||||
The text to generate mesh from.
|
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>
|
||||||
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="TextServer.Direction" default="0">
|
<member name="text_direction" type="int" setter="set_text_direction" getter="get_text_direction" enum="TextServer.Direction" default="0">
|
||||||
Base text writing direction.
|
Base text writing direction.
|
||||||
|
@ -208,7 +208,7 @@ void Label3D::_notification(int p_what) {
|
|||||||
viewport->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
|
viewport->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||||
String new_text = tr(text);
|
String new_text = atr(text);
|
||||||
if (new_text == xl_text) {
|
if (new_text == xl_text) {
|
||||||
return; // Nothing new.
|
return; // Nothing new.
|
||||||
}
|
}
|
||||||
@ -636,7 +636,7 @@ void Label3D::_shape() {
|
|||||||
|
|
||||||
void Label3D::set_text(const String &p_string) {
|
void Label3D::set_text(const String &p_string) {
|
||||||
text = p_string;
|
text = p_string;
|
||||||
xl_text = tr(p_string);
|
xl_text = atr(p_string);
|
||||||
dirty_text = true;
|
dirty_text = true;
|
||||||
_queue_update();
|
_queue_update();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user