diff options
author | BlockMen <nmuelll@web.de> | 2013-07-17 21:18:24 +0200 |
---|---|---|
committer | RealBadAngel <mk@realbadangel.pl> | 2013-07-24 01:01:56 +0200 |
commit | 8e2467c393e8dcb3f0d48b9e3258bf0526e6256f (patch) | |
tree | cb0ddefad7a59aae8cfa33937c07ee752e1f3c1c | |
parent | 3629a90c2ee315453c8d654a308645bdbdc40074 (diff) | |
download | minetest-8e2467c393e8dcb3f0d48b9e3258bf0526e6256f.tar.gz minetest-8e2467c393e8dcb3f0d48b9e3258bf0526e6256f.tar.bz2 minetest-8e2467c393e8dcb3f0d48b9e3258bf0526e6256f.zip |
Add gettext translation for image_button
-rw-r--r-- | src/guiFormSpecMenu.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/guiFormSpecMenu.cpp b/src/guiFormSpecMenu.cpp index a67768deb..e950c088b 100644 --- a/src/guiFormSpecMenu.cpp +++ b/src/guiFormSpecMenu.cpp @@ -1151,9 +1151,16 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,std: label = unescape_string(label); + wchar_t* wlabel = 0; + + if (m_use_gettext) + wlabel = wgettext(label.c_str()); + else + wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str(); + FieldSpec spec = FieldSpec( narrow_to_wide(name.c_str()), - narrow_to_wide(label.c_str()), + wlabel, narrow_to_wide(image_name.c_str()), 258+m_fields.size() ); @@ -1182,6 +1189,8 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,std: e->setDrawBorder(drawborder); m_fields.push_back(spec); + if (m_use_gettext) + delete[] wlabel; return; } |