mirror of
https://github.com/minetest/minetest.git
synced 2024-11-26 17:43:45 +01:00
Add gettext translation for image_button
This commit is contained in:
parent
3629a90c2e
commit
8e2467c393
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user