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

Search all domains for language strings, fixes the mess that we used to use to translate strings in 3rd party modules

This commit is contained in:
Adam
2011-06-17 19:57:43 -04:00
parent 48e995ddf2
commit a1b36ec0a5
63 changed files with 767 additions and 633 deletions
+15 -2
View File
@@ -28,8 +28,15 @@ Module::Module(const Anope::string &modname, const Anope::string &, ModType modt
Modules.push_back(this);
#if GETTEXT_FOUND
if (!bindtextdomain(this->name.c_str(), (services_dir + "/languages/").c_str()))
Log() << "Error calling bindtextdomain, " << Anope::LastError();
for (unsigned i = 0; i < languages.size(); ++i)
if (IsFile("languages/" + languages[i] + "/LC_MESSAGES/" + modname + ".mo"))
{
if (!bindtextdomain(this->name.c_str(), (services_dir + "/languages/").c_str()))
Log() << "Error calling bindtextdomain, " << Anope::LastError();
else
domains.push_back(modname);
break;
}
#endif
}
@@ -45,6 +52,12 @@ Module::~Module()
std::list<Module *>::iterator it = std::find(Modules.begin(), Modules.end(), this);
if (it != Modules.end())
Modules.erase(it);
#if GETTEXT_FOUND
std::vector<Anope::string>::iterator dit = std::find(domains.begin(), domains.end(), this->name);
if (dit != domains.end())
domains.erase(dit);
#endif
}
void Module::SetPermanent(bool state)