Add possibility to specify non-translated texts in GUI XML files, and use it for debug strings that should not be translated

This commit is contained in:
Marianne Gagnon 2014-12-05 19:17:52 -05:00
parent 1e2656dc88
commit f05618b3b9
4 changed files with 20 additions and 13 deletions

View File

@ -2,37 +2,37 @@
<stkgui> <stkgui>
<div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" > <div x="2%" y="10%" width="96%" height="80%" layout="vertical-row" >
<div proportion="1" width="100%" layout="horizontal-row"> <div proportion="1" width="100%" layout="horizontal-row">
<label id="Red" text="Red"/> <label id="Red" raw_text="Red"/>
<spacer width="25"/> <spacer width="25"/>
<gauge id="red_slider" min_value="0" max_value="100" proportion="1"/> <gauge id="red_slider" min_value="0" max_value="100" proportion="1"/>
</div> </div>
<div proportion="1" width="100%" layout="horizontal-row"> <div proportion="1" width="100%" layout="horizontal-row">
<label id="Green" text="Green"/> <label id="Green" raw_text="Green"/>
<spacer width="25"/> <spacer width="25"/>
<gauge id="green_slider" min_value="0" max_value="100" proportion="1"/> <gauge id="green_slider" min_value="0" max_value="100" proportion="1"/>
</div> </div>
<div proportion="1" width="100%" layout="horizontal-row"> <div proportion="1" width="100%" layout="horizontal-row">
<label id="Blue" text="Blue"/> <label id="Blue" raw_text="Blue"/>
<spacer width="25"/> <spacer width="25"/>
<gauge id="blue_slider" min_value="0" max_value="100" proportion="1"/> <gauge id="blue_slider" min_value="0" max_value="100" proportion="1"/>
</div> </div>
<div proportion="1" width="100%" layout="horizontal-row"> <div proportion="1" width="100%" layout="horizontal-row">
<label id="SSAO radius" text="SSAO Radius"/> <label id="SSAO radius" raw_text="SSAO Radius"/>
<spacer width="50"/> <spacer width="50"/>
<gauge id="ssao_radius" min_value="0" max_value="100" proportion="1" /> <gauge id="ssao_radius" min_value="0" max_value="100" proportion="1" />
</div> </div>
<div proportion="1" width="100%" layout="horizontal-row"> <div proportion="1" width="100%" layout="horizontal-row">
<label id="SSAO k" text="SSAO K"/> <label id="SSAO k" raw_text="SSAO K"/>
<spacer width="25"/> <spacer width="25"/>
<gauge id="ssao_k" min_value="0" max_value="100" proportion="1"/> <gauge id="ssao_k" min_value="0" max_value="100" proportion="1"/>
</div> </div>
<div proportion="1" width="100%" layout="horizontal-row"> <div proportion="1" width="100%" layout="horizontal-row">
<label id="SSAO Sigma" text="SSAO sigma"/> <label id="SSAO Sigma" raw_text="SSAO sigma"/>
<spacer width="50"/> <spacer width="50"/>
<gauge id="ssao_sigma" min_value="0" max_value="100" proportion="1"/> <gauge id="ssao_sigma" min_value="0" max_value="100" proportion="1"/>
</div> </div>

View File

@ -40,17 +40,17 @@
<buttonbar id="menu_bottomrow" x="0" y="0" width="38%" height="100%" align="center"> <buttonbar id="menu_bottomrow" x="0" y="0" width="38%" height="100%" align="center">
<icon-button id="test_gpwin" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="test_gpwin" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: GPWin" label_location="hover"/> raw_text="TEST: GPWin" label_location="hover"/>
<icon-button id="test_gplose" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="test_gplose" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: GPLose" label_location="hover"/> raw_text="TEST: GPLose" label_location="hover"/>
<icon-button id="test_unlocked" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="test_unlocked" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: Unlocked" label_location="hover"/> raw_text="TEST: Unlocked" label_location="hover"/>
<icon-button id="test_unlocked2" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="test_unlocked2" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: Unlocked 2" label_location="hover"/> raw_text="TEST: Unlocked 2" label_location="hover"/>
<icon-button id="test_intro" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="test_intro" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: Intro" label_location="hover"/> raw_text="TEST: Intro" label_location="hover"/>
<icon-button id="test_outro" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="test_outro" width="64" height="64" icon="gui/main_options.png" extend_label="50"
text="TEST: Outro" label_location="hover"/> raw_text="TEST: Outro" label_location="hover"/>
<icon-button id="options" width="64" height="64" icon="gui/main_options.png" extend_label="50" <icon-button id="options" width="64" height="64" icon="gui/main_options.png" extend_label="50"
I18N="In the main screen" text="Options" label_location="hover"/> I18N="In the main screen" text="Options" label_location="hover"/>
<icon-button id="help" width="64" height="64" icon="gui/main_help.png" extend_label="50" <icon-button id="help" width="64" height="64" icon="gui/main_help.png" extend_label="50"

View File

@ -288,7 +288,7 @@ namespace GUIEngine
\n \n
\subsection prop2 PROP_TEXT \subsection prop2 PROP_TEXT
<em> Name in XML files: </em> \c "text" <em> Name in XML files: </em> \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 gives text (a label) to the widget where supported. Ribbon-grids give a
special meaning to this parameter, see ribbon-grid docs above. special meaning to this parameter, see ribbon-grid docs above.

View File

@ -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); 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) if (parent != NULL)
{ {
widget.setParent(parent); widget.setParent(parent);