Skip to content

Commit

Permalink
Add gettext translation for image_button
Browse files Browse the repository at this point in the history
  • Loading branch information
BlockMen authored and RealBadAngel committed Jul 23, 2013
1 parent 3629a90 commit 8e2467c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/guiFormSpecMenu.cpp
Expand Up @@ -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()
);
Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 8e2467c

Please sign in to comment.