1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-10-04 21:34:41 +00:00

_mods/x/locales/y/* now works

This commit is contained in:
fgenesis 2012-07-14 15:00:37 +02:00
commit 636c069403
5 changed files with 29 additions and 7 deletions

View file

@ -26,6 +26,7 @@ static std::string _CFToStdString(CFStringRef cs)
#endif
static std::string s_locale;
static std::string s_modpath;
void setUsedLocale(const std::string& s)
{
@ -37,6 +38,26 @@ const char *getUsedLocale()
return s_locale.c_str();
}
void setLocalisationModPath(const std::string& s)
{
s_modpath = s;
stringToLower(s_modpath);
}
// hackish
// intended to be used only for paths which are known to start with the mod path,
// but can deal with it if this is not the case
std::string localisePathInternalModpath(const std::string &path)
{
std::string tmp = path;
stringToLower(tmp);
if(!strncmp(tmp.c_str(), s_modpath.c_str(), s_modpath.length()))
return localisePath(path, s_modpath);
return localisePath(path);
}
std::string localisePath(const std::string &path, const std::string& modpath /* = "" */)
{
if (s_locale.empty())