From f93993dd417e3d88927ac22628aebe976b9ad05f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 31 Oct 2012 23:50:06 +0300 Subject: Fix gettext under Android. --- src/client.cpp | 8 ++++++-- src/client.h | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index 858c7ff49..878dd9360 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -338,12 +338,17 @@ void Client::gameInit() putenv(const_cast(("LANG=" + lang).c_str())); putenv(const_cast(("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()); #else bindTextDomain("manaplus", LOCALEDIR); #endif +#endif #endif char *locale = setlocale(LC_MESSAGES, lang.c_str()); if (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; -- cgit v1.2.3-70-g09d2