diff options
author | Andrei Karas <akaras@inbox.ru> | 2012-10-31 23:50:06 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2012-10-31 23:50:06 +0300 |
commit | f93993dd417e3d88927ac22628aebe976b9ad05f (patch) | |
tree | ad0afd3c1873f8f191a2ee16d54e75250b57e0a5 | |
parent | 87e8f99916b8537e2a9bbe7ef80e8c6a250afb90 (diff) | |
download | manaverse-f93993dd417e3d88927ac22628aebe976b9ad05f.tar.gz manaverse-f93993dd417e3d88927ac22628aebe976b9ad05f.tar.bz2 manaverse-f93993dd417e3d88927ac22628aebe976b9ad05f.tar.xz manaverse-f93993dd417e3d88927ac22628aebe976b9ad05f.zip |
Fix gettext under Android.
-rw-r--r-- | src/client.cpp | 8 | ||||
-rw-r--r-- | src/client.h | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/client.cpp b/src/client.cpp index 858c7ff49..878dd9360 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -338,6 +338,10 @@ void Client::gameInit() putenv(const_cast<char*>(("LANG=" + lang).c_str())); putenv(const_cast<char*>(("LANGUAGE=" + lang).c_str())); } +#ifdef ANDROID + bindTextDomain("manaplus", (std::string(PHYSFS_getBaseDir()) + + "/locale").c_str()); +#else #ifdef ENABLE_PORTABLE bindTextDomain("manaplus", (std::string(PHYSFS_getBaseDir()) + "../locale/").c_str()); @@ -345,6 +349,7 @@ void Client::gameInit() bindTextDomain("manaplus", LOCALEDIR); #endif #endif +#endif char *locale = setlocale(LC_MESSAGES, lang.c_str()); if (locale) logger->log("locale: %s", locale); @@ -422,7 +427,6 @@ void Client::gameInit() "Exiting.", mLocalDataDir.c_str())); } - resman->addToSearchPath(PKG_DATADIR "data/perserver/default", false); #if defined __APPLE__ @@ -670,7 +674,7 @@ Client::~Client() testsClear(); } -void Client::bindTextDomain(char *name, char *path) +void Client::bindTextDomain(const char *const name, const char *const path) { const char *const dir = bindtextdomain(name, path); if (dir) diff --git a/src/client.h b/src/client.h index c6427a720..43937c956 100644 --- a/src/client.h +++ b/src/client.h @@ -348,7 +348,7 @@ private: static Client *mInstance; - static void bindTextDomain(char *name, char *path); + static void bindTextDomain(const char *const name, const char *const path); Options mOptions; |