Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
A-lex-Ra committed Dec 26, 2023
2 parents 307df37 + ee29777 commit 1b51fdb
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 @@ -143,15 +143,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 @@ -65,7 +65,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 1b51fdb

Please sign in to comment.