Solved the problem with custom menu labels not properly displayed.
This commit is contained in:
parent
7d2955347e
commit
560e7a3d12
1 changed files with 6 additions and 4 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue