Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6257c7f

Browse files
minduser00SmallJoker
authored andcommittedApr 9, 2018
Fix for translating empty strings
Fix for incorrect translation of empty strings In the key change menu, when a button key not have name an empty string is passed to gettext. The empty string is reserved for gettext to return de header of the .po file an this is shoved in the button
1 parent af86842 commit 6257c7f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
 

‎src/gui/guiKeyChangeMenu.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
153153
{
154154
core::rect < s32 > rect(0, 0, 100, 30);
155155
rect += topleft + v2s32(offset.X + 120, offset.Y - 5);
156-
const wchar_t *text = wgettext(k->key.name());
157-
k->button = Environment->addButton(rect, this, k->id, text);
158-
delete[] text;
156+
k->button = Environment->addButton(rect, this, k->id,
157+
k->key.name()[0] ? wgettext(k->key.name()) : L"");
159158
}
160159
if ((i + 1) % KMaxButtonPerColumns == 0) {
161160
offset.X += 230;

0 commit comments

Comments
 (0)
Please sign in to comment.