From f05618b3b91b47dfc7fa11a02dd615692f69d922 Mon Sep 17 00:00:00 2001 From: Marianne Gagnon Date: Fri, 5 Dec 2014 19:17:52 -0500 Subject: [PATCH] Add possibility to specify non-translated texts in GUI XML files, and use it for debug strings that should not be translated --- data/gui/debug_slider.stkgui | 12 ++++++------ data/gui/main.stkgui | 12 ++++++------ src/guiengine/engine.cpp | 2 +- src/guiengine/screen_loader.cpp | 7 +++++++ 4 files changed, 20 insertions(+), 13 deletions(-) diff --git a/data/gui/debug_slider.stkgui b/data/gui/debug_slider.stkgui index 270f892b7..a0285405c 100644 --- a/data/gui/debug_slider.stkgui +++ b/data/gui/debug_slider.stkgui @@ -2,37 +2,37 @@
-
-
-
-
-
-
diff --git a/data/gui/main.stkgui b/data/gui/main.stkgui index 788b48e71..11769b286 100644 --- a/data/gui/main.stkgui +++ b/data/gui/main.stkgui @@ -40,17 +40,17 @@ + raw_text="TEST: GPWin" label_location="hover"/> + raw_text="TEST: GPLose" label_location="hover"/> + raw_text="TEST: Unlocked" label_location="hover"/> + raw_text="TEST: Unlocked 2" label_location="hover"/> + raw_text="TEST: Intro" label_location="hover"/> + raw_text="TEST: Outro" label_location="hover"/> Name in XML files: \c "text" + Name in XML files: \c "text" or "raw_text" ("text" is translated, "raw_text" is not) gives text (a label) to the widget where supported. Ribbon-grids give a special meaning to this parameter, see ribbon-grid docs above. diff --git a/src/guiengine/screen_loader.cpp b/src/guiengine/screen_loader.cpp index 1c1c5a23e..4126806cc 100644 --- a/src/guiengine/screen_loader.cpp +++ b/src/guiengine/screen_loader.cpp @@ -232,6 +232,13 @@ if(prop_name != NULL) widget.m_properties[prop_flag] = core::stringc(prop_name). widget.m_is_text_rtl = (translations->isRTLLanguage() && widget.m_text != text); } + const wchar_t* raw_text = xml->getAttributeValue(L"raw_text"); + + if (raw_text != NULL) + { + widget.m_text = raw_text; + } + if (parent != NULL) { widget.setParent(parent);