From 560e7a3d120ea1c7ffc9f0458eb29cf1ad42693a Mon Sep 17 00:00:00 2001 From: SDeAstis Date: Mon, 15 Nov 2021 23:25:05 +0100 Subject: [PATCH] Solved the problem with custom menu labels not properly displayed. --- src/GUI/menubar.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/GUI/menubar.cxx b/src/GUI/menubar.cxx index 684641725..2a18fcfc5 100644 --- a/src/GUI/menubar.cxx +++ b/src/GUI/menubar.cxx @@ -23,10 +23,12 @@ FGMenuBar::getLocalizedLabel(SGPropertyNode* node) if (!node) return {}; - std::string name = node->getStringValue("name", ""); - const auto translated = globals->get_locale()->getLocalizedString(name, "menu"); - if (!translated.empty()) - return translated; + std::string name = node->getStringValue("name", ""); + if (!name.empty()) { + const auto translated = globals->get_locale()->getLocalizedString(name, "menu"); + if (!translated.empty()) + return translated; + } // return default with fallback to name std::string label = node->getStringValue("label", name.c_str());