summaryrefslogtreecommitdiff
path: root/src/utils/gettexthelper.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-30 21:03:20 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-31 12:16:43 +0300
commitc0197404a15a3937ef3cd21f48a09e691a96518f (patch)
tree582b01cfc1c716b19122fe28f57abefb3bf5b716 /src/utils/gettexthelper.cpp
parent9bb11133522836a9c5e251550ac88c9a4e091c0e (diff)
downloadmanaverse-c0197404a15a3937ef3cd21f48a09e691a96518f.tar.gz
manaverse-c0197404a15a3937ef3cd21f48a09e691a96518f.tar.bz2
manaverse-c0197404a15a3937ef3cd21f48a09e691a96518f.tar.xz
manaverse-c0197404a15a3937ef3cd21f48a09e691a96518f.zip
fix code style.
Diffstat (limited to 'src/utils/gettexthelper.cpp')
-rw-r--r--src/utils/gettexthelper.cpp24
1 files changed, 18 insertions, 6 deletions
diff --git a/src/utils/gettexthelper.cpp b/src/utils/gettexthelper.cpp
index 59f4933ad..3d10c6848 100644
--- a/src/utils/gettexthelper.cpp
+++ b/src/utils/gettexthelper.cpp
@@ -20,13 +20,22 @@
#include "utils/gettexthelper.h"
+#include "client.h"
+#include "configuration.h"
+
#include "debug.h"
+#ifdef ENABLE_NLS
+#include "logger.h"
+
+#include <libintl.h>
+#endif
+
#ifdef WIN32
+#include <string>
extern "C" char const *_nl_locale_name_default(void);
#endif
-
void GettextHelper::initLang()
{
#ifdef ENABLE_NLS
@@ -44,8 +53,8 @@ void GettextHelper::initLang()
if (!lang.empty())
{
- setEnv("LANG", lang.c_str());
- setEnv("LANGUAGE", lang.c_str());
+ Client::setEnv("LANG", lang.c_str());
+ Client::setEnv("LANGUAGE", lang.c_str());
}
#ifdef ANDROID
#ifdef USE_SDL2
@@ -87,16 +96,19 @@ void GettextHelper::initLang()
bind_textdomain_codeset("manaplus", "UTF-8");
textdomain("manaplus");
#endif // ENABLE_NLS
-
}
+#ifdef ENABLE_NLS
void GettextHelper::bindTextDomain(const char *const path)
{
-#ifdef ENABLE_NLS
const char *const dir = bindtextdomain("manaplus", path);
if (dir)
logger->log("bindtextdomain: %s", dir);
else
logger->log("bindtextdomain failed");
-#endif
}
+#else
+void GettextHelper::bindTextDomain(const char *const path A_UNUSED)
+{
+}
+#endif