Fix init order so ForceEnglish option actually works.

This commit is contained in:
J-D-K
2025-08-20 18:56:27 -04:00
parent 2a48b18b49
commit 280e5d6cb9
5 changed files with 17 additions and 10 deletions

View File

@@ -1,8 +1,10 @@
#include "strings/strings.hpp"
#include "JSON.hpp"
#include "config/config.hpp"
#include "fslib.hpp"
#include "logging/error.hpp"
#include "logging/logger.hpp"
#include "stringutil.hpp"
#include <map>
@@ -92,9 +94,10 @@ static fslib::Path get_file_path()
uint64_t languageCode{};
SetLanguage language{};
const bool codeError = error::libnx(setGetLanguageCode(&languageCode));
const bool langError = !codeError && error::libnx(setMakeLanguage(languageCode, &language));
if (codeError || langError) { returnPath /= s_fileMap[SetLanguage_ENUS]; }
const bool forceEnglish = config::get_by_key(config::keys::FORCE_ENGLISH);
const bool codeError = error::libnx(setGetLanguageCode(&languageCode));
const bool langError = !codeError && error::libnx(setMakeLanguage(languageCode, &language));
if (forceEnglish || codeError || langError) { returnPath /= s_fileMap[SetLanguage_ENUS]; }
else { returnPath /= s_fileMap[language]; }
return returnPath;