summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-06-28 17:00:18 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-06-28 17:01:35 -0300
commitdb3b05d2893dcaddeb3bcb10b845ff150eb50895 (patch)
treee19d761357300ba03360593e3cbdda01e87f215e /scene/gui
parent9e54e1f34f7ee0b100b45fa2388f25096eb90670 (diff)
Reworked translation system
-Label and Button reload translation on the fly -Resources are loaded and reload depending on locale
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/label.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/label.cpp b/scene/gui/label.cpp
index f3a279bada..fb85930ceb 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();
}