Skip to content

Commit 8e2467c

Browse files
BlockMenRealBadAngel
authored andcommittedJul 23, 2013
Add gettext translation for image_button
1 parent 3629a90 commit 8e2467c

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed
 

‎src/guiFormSpecMenu.cpp

+10-1
Original file line numberDiff line numberDiff line change
@@ -1151,9 +1151,16 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,std:
11511151

11521152
label = unescape_string(label);
11531153

1154+
wchar_t* wlabel = 0;
1155+
1156+
if (m_use_gettext)
1157+
wlabel = wgettext(label.c_str());
1158+
else
1159+
wlabel = (wchar_t*) narrow_to_wide(label.c_str()).c_str();
1160+
11541161
FieldSpec spec = FieldSpec(
11551162
narrow_to_wide(name.c_str()),
1156-
narrow_to_wide(label.c_str()),
1163+
wlabel,
11571164
narrow_to_wide(image_name.c_str()),
11581165
258+m_fields.size()
11591166
);
@@ -1182,6 +1189,8 @@ void GUIFormSpecMenu::parseImageButton(parserData* data,std::string element,std:
11821189
e->setDrawBorder(drawborder);
11831190

11841191
m_fields.push_back(spec);
1192+
if (m_use_gettext)
1193+
delete[] wlabel;
11851194
return;
11861195
}
11871196

0 commit comments

Comments
 (0)
Please sign in to comment.