summaryrefslogtreecommitdiff
path: root/src/module.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/module.cpp')
-rw-r--r--src/module.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/module.cpp b/src/module.cpp
index fc554fce2..0511ad026 100644
--- a/src/module.cpp
+++ b/src/module.cpp
@@ -11,7 +11,7 @@
#include "language.h"
#include "account.h"
-#ifdef GETTEXT_FOUND
+#if HAVE_LOCALIZATION
# include <libintl.h>
#endif
@@ -39,14 +39,14 @@ Module::Module(const Anope::string &modname, const Anope::string &, ModType modt
ModuleManager::Modules.push_back(this);
-#if GETTEXT_FOUND
- for (unsigned i = 0; i < Language::Languages.size(); ++i)
+#if HAVE_LOCALIZATION
+ for (const auto &language : Language::Languages)
{
/* Remove .UTF-8 or any other suffix */
Anope::string lang;
- sepstream(Language::Languages[i], '.').GetToken(lang);
+ sepstream(language, '.').GetToken(lang);
- if (Anope::IsFile(Anope::LocaleDir + "/" + lang + "/LC_MESSAGES/" + modname + ".mo"))
+ if (Anope::IsFile(Anope::ExpandLocale(lang + "/LC_MESSAGES/" + modname + ".mo")))
{
if (!bindtextdomain(this->name.c_str(), Anope::LocaleDir.c_str()))
Log() << "Error calling bindtextdomain, " << Anope::LastError();
@@ -75,7 +75,7 @@ Module::~Module()
if (it != ModuleManager::Modules.end())
ModuleManager::Modules.erase(it);
-#if GETTEXT_FOUND
+#if HAVE_LOCALIZATION
std::vector<Anope::string>::iterator dit = std::find(Language::Domains.begin(), Language::Domains.end(), this->name);
if (dit != Language::Domains.end())
Language::Domains.erase(dit);