diff --git a/i18n/i18n.cpp b/i18n/i18n.cpp index 6b93848b7a..84e7e79822 100644 --- a/i18n/i18n.cpp +++ b/i18n/i18n.cpp @@ -72,14 +72,20 @@ bool I18NRepo::IniExists(const std::string &languageID) const { return true; } -bool I18NRepo::LoadIni(const std::string &languageID) { +bool I18NRepo::LoadIni(const std::string &languageID, const std::string &overridePath) { IniFile ini; - std::string iniPath = GetIniPath(languageID); + std::string iniPath; + // ILOG("Loading lang ini %s", iniPath.c_str()); - if (!ini.LoadFromVFS(GetIniPath(languageID))) { - return false; + if (!overridePath.empty()) { + iniPath = overridePath + languageID + ".ini"; + } else { + iniPath = GetIniPath(languageID); } + if (!ini.LoadFromVFS(iniPath)) + return false; + Clear(); const std::vector §ions = ini.Sections(); diff --git a/i18n/i18n.h b/i18n/i18n.h index b889a9c2d6..2a52b21043 100644 --- a/i18n/i18n.h +++ b/i18n/i18n.h @@ -66,7 +66,7 @@ public: ~I18NRepo(); bool IniExists(const std::string &languageID) const; - bool LoadIni(const std::string &languageID); // NOT the filename! + bool LoadIni(const std::string &languageID, const std::string &overridePath = ""); // NOT the filename! void SaveIni(const std::string &languageID); I18NCategory *GetCategory(const char *categoryName);