From a42129a1a9865ad9f094367c8135e4c3e632e9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=93=D0=B5=D1=80=D1=85=D0=B0=D1=80=D0=B4=20PICCORO=20Len?= =?UTF-8?q?z=20McKAY?= Date: Wed, 3 Nov 2021 13:14:33 -0400 Subject: [PATCH] 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 https://github.com/minuser00/minetest/commit/67cceb50649d00ac5afea053966ffa8551628c33 --- src/guiKeyChangeMenu.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/guiKeyChangeMenu.cpp b/src/guiKeyChangeMenu.cpp index ae53c56f9..5909c1bdc 100644 --- a/src/guiKeyChangeMenu.cpp +++ b/src/guiKeyChangeMenu.cpp @@ -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; }