From fe41c9bd7dfee3e16107bf88bf48eebf37059e35 Mon Sep 17 00:00:00 2001 From: Thierry Crozat Date: Fri, 16 Jul 2021 21:20:18 +0100 Subject: [PATCH] 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. --- gui/ThemeEngine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 8ec8ac4b269..9df06b6932e 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -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)