1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 09:16:38 +02:00

Changed the language system to use gettext

This commit is contained in:
Adam
2010-09-26 02:33:01 -04:00
parent 05e6815d91
commit d646d455e2
239 changed files with 168730 additions and 90259 deletions
+11 -9
View File
@@ -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 */