Merge pull request #196 from thedax/allowi18nPathOverride

Allow i18n path override for easier translation testing on mobile devices
This commit is contained in:
Henrik Rydgård committed 2014-02-13 00:51:30 +01:00
commit f7f5e2c3ff
2 files changed
+11 -5

No files matched your search

+10 -4
View File
@@ -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<IniFile::Section> &sections = ini.Sections();
+1 -1
View File
@@ -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);