summaryrefslogtreecommitdiff
path: root/src/module.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2010-09-26 02:33:01 -0400
committerAdam <Adam@anope.org>2010-09-26 02:33:01 -0400
commitd646d455e2655be59f6d5bcc56710ac70548ca37 (patch)
treed236b9d4991d62538a0318f213416396734e72e0 /src/module.cpp
parent05e6815d912f0418f6da25a2106dd718796f02fa (diff)
Changed the language system to use gettext
Diffstat (limited to 'src/module.cpp')
-rw-r--r--src/module.cpp20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/module.cpp b/src/module.cpp
index 148901180..da6673dbf 100644
--- a/src/module.cpp
+++ b/src/module.cpp
@@ -7,7 +7,10 @@
*/
#include "modules.h"
-#include "language.h"
+
+#ifdef HAVE_GETTEXT
+# include <libintl.h>
+#endif
Module::Module(const Anope::string &mname, const Anope::string &creator)
{
@@ -17,9 +20,6 @@ Module::Module(const Anope::string &mname, const Anope::string &creator)
this->permanent = false;
- for (int i = 0; i < NUM_LANGS; ++i)
- this->lang[i].argc = 0;
-
if (FindModule(this->name))
throw CoreException("Module already exists!");
@@ -28,15 +28,17 @@ Module::Module(const Anope::string &mname, const Anope::string &creator)
this->SetVersion(Anope::Version());
Modules.push_back(this);
+
+#if HAVE_GETTEXT
+ if (!bindtextdomain(this->name.c_str(), (services_dir + "/languages/").c_str()))
+ {
+ Log() << "Error calling bindtextdomain, " << Anope::LastError();
+ }
+#endif
}
Module::~Module()
{
- int i = 0;
-
- for (i = 0; i < NUM_LANGS; ++i)
- this->DeleteLanguage(i);
-
/* Detach all event hooks for this module */
ModuleManager::DetachAll(this);
/* Clear any active callbacks this module has */