Skip to content

Commit

Permalink
Fix for translating empty strings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
minduser00 authored and SmallJoker committed Apr 9, 2018
1 parent af86842 commit 6257c7f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/gui/guiKeyChangeMenu.cpp
Expand Up @@ -153,9 +153,8 @@ void GUIKeyChangeMenu::regenerateGui(v2u32 screensize)
{
core::rect < s32 > rect(0, 0, 100, 30);
rect += topleft + v2s32(offset.X + 120, offset.Y - 5);
const wchar_t *text = wgettext(k->key.name());
k->button = Environment->addButton(rect, this, k->id, text);
delete[] text;
k->button = Environment->addButton(rect, this, k->id,
k->key.name()[0] ? wgettext(k->key.name()) : L"");
}
if ((i + 1) % KMaxButtonPerColumns == 0) {
offset.X += 230;
Expand Down

0 comments on commit 6257c7f

Please sign in to comment.