diff --git a/src/frontend/locale/langs.cpp b/src/frontend/locale/langs.cpp index 762e27566..d703cbb4c 100644 --- a/src/frontend/locale/langs.cpp +++ b/src/frontend/locale/langs.cpp @@ -120,15 +120,20 @@ void langs::load(const path& resdir, const vector& packs) { unique_ptr lang (new Lang(locale)); load(resdir, fallback, packs, *lang.get()); - load(resdir, locale, packs, *lang.get()); + if (locale != fallback) { + load(resdir, locale, packs, *lang.get()); + } current.reset(lang.release()); } void langs::setup(const path& resdir, - const string& locale, + string locale, const vector& packs) { string fallback = langs::FALLBACK_DEFAULT; langs::loadLocalesInfo(resdir, fallback); + if (langs::locales_info.find(locale) == langs::locales_info.end()) { + locale = fallback; + } langs::load(resdir, locale, fallback, packs); } diff --git a/src/frontend/locale/langs.h b/src/frontend/locale/langs.h index 7f6d916c2..0e48a8399 100644 --- a/src/frontend/locale/langs.h +++ b/src/frontend/locale/langs.h @@ -62,7 +62,7 @@ namespace langs { const std::wstring& context); extern void setup(const std::filesystem::path& resdir, - const std::string& locale, + std::string locale, const std::vector& packs); }