Skip to content

Commit

Permalink
Critical fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Dec 26, 2023
1 parent 92a08a9 commit ee29777
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions src/frontend/locale/langs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,20 @@ void langs::load(const path& resdir,
const vector<ContentPack>& packs) {
unique_ptr<Lang> 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<ContentPack>& 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);
}

Expand Down
2 changes: 1 addition & 1 deletion src/frontend/locale/langs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ContentPack>& packs);
}

Expand Down

0 comments on commit ee29777

Please sign in to comment.