From db3b05d2893dcaddeb3bcb10b845ff150eb50895 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 28 Jun 2017 17:00:18 -0300 Subject: Reworked translation system -Label and Button reload translation on the fly -Resources are loaded and reload depending on locale --- scene/gui/label.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scene/gui/label.cpp') diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp index f3a279bad..fb85930ce 100644 --- a/scene/gui/label.cpp +++ b/scene/gui/label.cpp @@ -65,7 +65,12 @@ void Label::_notification(int p_what) { if (p_what == NOTIFICATION_TRANSLATION_CHANGED) { - xl_text = XL_MESSAGE(text); + String new_text = XL_MESSAGE(text); + if (new_text == xl_text) + return; //nothing new + xl_text = new_text; + + regenerate_word_cache(); minimum_size_changed(); update(); } -- cgit v1.2.3-70-g09d2