diff options
author | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-09-26 15:35:24 -0400 |
---|---|---|
committer | Naram Qashat <cyberbotx@cyberbotx.com> | 2010-09-26 15:35:24 -0400 |
commit | 7db5e19f7499cce5b86d63f8af5ae5ecf7245bf0 (patch) | |
tree | 532fc89a01b88eb427d714940b015a61a7e960cb /src | |
parent | f3840ed110ecaac1a2777692b714f283600d9afa (diff) |
Partial fix for finding gettext with CMake, still doesn't fix the lack of finding non-standard paths though.
Diffstat (limited to 'src')
-rw-r--r-- | src/language.cpp | 8 | ||||
-rw-r--r-- | src/module.cpp | 6 | ||||
-rw-r--r-- | src/modules.cpp | 2 |
3 files changed, 7 insertions, 9 deletions
diff --git a/src/language.cpp b/src/language.cpp index 3744770a9..8fd15a693 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -1,6 +1,6 @@ #include "services.h" -#if HAVE_GETTEXT +#if GETTEXT_FOUND # include <libintl.h> # define _(x) gettext(x) #else @@ -11,7 +11,7 @@ std::vector<Anope::string> languages; void InitLanguages() { -#if HAVE_GETTEXT +#if GETTEXT_FOUND languages.clear(); spacesepstream sep(Config->Languages); Anope::string language; @@ -40,7 +40,7 @@ void InitLanguages() const Anope::string GetString(Anope::string language, LanguageString string) { -#if HAVE_GETTEXT +#if GETTEXT_FOUND /* For older databases */ if (language == "en") language.clear(); @@ -53,7 +53,7 @@ const Anope::string GetString(Anope::string language, LanguageString string) #endif return language_strings[string]; -#if HAVE_GETTEXT +#if GETTEXT_FOUND setlocale(LC_ALL, language.c_str()); const char *ret = dgettext("anope", language_strings[string].c_str()); setlocale(LC_ALL, ""); diff --git a/src/module.cpp b/src/module.cpp index da6673dbf..2b7676550 100644 --- a/src/module.cpp +++ b/src/module.cpp @@ -8,7 +8,7 @@ #include "modules.h" -#ifdef HAVE_GETTEXT +#ifdef GETTEXT_FOUND # include <libintl.h> #endif @@ -29,11 +29,9 @@ Module::Module(const Anope::string &mname, const Anope::string &creator) Modules.push_back(this); -#if HAVE_GETTEXT +#if GETTEXT_FOUND if (!bindtextdomain(this->name.c_str(), (services_dir + "/languages/").c_str())) - { Log() << "Error calling bindtextdomain, " << Anope::LastError(); - } #endif } diff --git a/src/modules.cpp b/src/modules.cpp index 47158f5e9..127620333 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -308,7 +308,7 @@ void Module::SendMessage(BotInfo *from, User *to, const char *fmt, ...) language = Config->NSDefLanguage; const char *message = fmt; -#if HAVE_GETTEXT +#if GETTEXT_FOUND if (!language.empty()) { setlocale(LC_ALL, language.c_str()); |