Key change menu: Fix for translating empty string

* Fix for incorrect translation of empty strings in key change menu
  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
* backported 67cceb5064
This commit is contained in:
Герхард PICCORO Lenz McKAY 2021-11-03 13:14:33 -04:00
parent eb306b9f36
commit a42129a1a9

View File

@ -152,7 +152,7 @@ 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());
const wchar_t *text = k->key.name()[0] ? wgettext(k->key.name()) : utf8_to_wide_c("");
k->button = Environment->addButton(rect, this, k->id, text);
delete[] text;
}