Skip to content

Commit be64901

Browse files
minduser00SmallJoker
authored andcommittedApr 9, 2018
Fix empty string translation
It was my first idea, but I couldn't make it work with *L"", this time I copied the way wgettext returns a string and it seems to work It needs to be tested, I could only do it in linux and travis CI
1 parent 6257c7f commit be64901

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

Diff for: ‎src/gui/guiKeyChangeMenu.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,9 @@ 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-
k->button = Environment->addButton(rect, this, k->id,
157-
k->key.name()[0] ? wgettext(k->key.name()) : L"");
156+
const wchar_t *text = k->key.name()[0] ? wgettext(k->key.name()) : utf8_to_wide_c("");
157+
k->button = Environment->addButton(rect, this, k->id, text);
158+
delete[] text;
158159
}
159160
if ((i + 1) % KMaxButtonPerColumns == 0) {
160161
offset.X += 230;

0 commit comments

Comments
 (0)