mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
Critical fix
This commit is contained in:
parent
92a08a92ef
commit
ee29777765
2 changed files with 8 additions and 3 deletions
|
|
@ -120,15 +120,20 @@ void langs::load(const path& resdir,
|
||||||
const vector<ContentPack>& packs) {
|
const vector<ContentPack>& packs) {
|
||||||
unique_ptr<Lang> lang (new Lang(locale));
|
unique_ptr<Lang> lang (new Lang(locale));
|
||||||
load(resdir, fallback, packs, *lang.get());
|
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());
|
current.reset(lang.release());
|
||||||
}
|
}
|
||||||
|
|
||||||
void langs::setup(const path& resdir,
|
void langs::setup(const path& resdir,
|
||||||
const string& locale,
|
string locale,
|
||||||
const vector<ContentPack>& packs) {
|
const vector<ContentPack>& packs) {
|
||||||
string fallback = langs::FALLBACK_DEFAULT;
|
string fallback = langs::FALLBACK_DEFAULT;
|
||||||
langs::loadLocalesInfo(resdir, fallback);
|
langs::loadLocalesInfo(resdir, fallback);
|
||||||
|
if (langs::locales_info.find(locale) == langs::locales_info.end()) {
|
||||||
|
locale = fallback;
|
||||||
|
}
|
||||||
langs::load(resdir, locale, fallback, packs);
|
langs::load(resdir, locale, fallback, packs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace langs {
|
||||||
const std::wstring& context);
|
const std::wstring& context);
|
||||||
|
|
||||||
extern void setup(const std::filesystem::path& resdir,
|
extern void setup(const std::filesystem::path& resdir,
|
||||||
const std::string& locale,
|
std::string locale,
|
||||||
const std::vector<ContentPack>& packs);
|
const std::vector<ContentPack>& packs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue