1
0
Fork 0

Solved the problem with custom menu labels not properly displayed.

This commit is contained in:
SDeAstis 2021-11-15 23:25:05 +01:00 committed by Julian Smith
parent 7d2955347e
commit 560e7a3d12

View file

@ -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());