GUI: Fix loading fonts when translations are disabled

This fixes bug #12737.
The issue is that ThemeEngine::addFont was skipping every font
when translations are disabled, including those for the English
language. Indeed for those the function is called with language
of "*" (since this is what is specified in the theme) and not
an empty string as the implementation assumed.
This commit is contained in:
Thierry Crozat 2021-07-16 21:20:18 +01:00
parent 0592520ddf
commit fe41c9bd7d

View file

@ -526,14 +526,14 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &language, const
if (!language.empty()) {
#ifdef USE_TRANSLATION
Common::String cl = TransMan.getCurrentLanguage();
#else
Common::String cl("C");
#endif
if (!cl.matchString(language, true))
return true; // Skip
if (_texts[textId] != nullptr) // We already loaded something
return true;
#else
return true; // Safely ignore
#endif
}
if (_texts[textId] != nullptr)