summaryrefslogtreecommitdiff
path: root/modules/core/db_plain.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 /modules/core/db_plain.cpp
parent05e6815d912f0418f6da25a2106dd718796f02fa (diff)
Changed the language system to use gettext
Diffstat (limited to 'modules/core/db_plain.cpp')
-rw-r--r--modules/core/db_plain.cpp37
1 files changed, 3 insertions, 34 deletions
diff --git a/modules/core/db_plain.cpp b/modules/core/db_plain.cpp
index ea366d299..dc108ac06 100644
--- a/modules/core/db_plain.cpp
+++ b/modules/core/db_plain.cpp
@@ -203,12 +203,6 @@ static void ReadDatabase(Module *m = NULL)
db.close();
}
-struct LangInfo
-{
- Anope::string Name;
- int LanguageId;
-};
-
struct ChannelFlagInfo
{
Anope::string Name;
@@ -233,23 +227,6 @@ struct NickCoreFlagInfo
NickCoreFlag Flag;
};
-LangInfo LangInfos[] = {
- {"en", LANG_EN_US},
- {"es", LANG_ES},
- {"pt", LANG_PT},
- {"fr", LANG_FR},
- {"tr", LANG_TR},
- {"it", LANG_IT},
- {"de", LANG_DE},
- {"ca", LANG_CAT},
- {"gr", LANG_GR},
- {"nl", LANG_NL},
- {"ru", LANG_RU},
- {"hu", LANG_HUN},
- {"pl", LANG_PL},
- {"", -1}
-};
-
ChannelFlagInfo ChannelInfoFlags[] = {
{"KEEPTOPIC", CI_KEEPTOPIC},
{"SECUREOPS", CI_SECUREOPS},
@@ -597,11 +574,7 @@ class DBPlain : public Module
EventReturn OnDatabaseReadMetadata(NickCore *nc, const Anope::string &key, const std::vector<Anope::string> &params)
{
if (key.equals_ci("LANGUAGE"))
- {
- for (int i = 0; LangInfos[i].LanguageId != -1; ++i)
- if (params[0].equals_ci(LangInfos[i].Name))
- nc->language = LangInfos[i].LanguageId;
- }
+ nc->language = params[0];
else if (key.equals_ci("MEMOMAX"))
nc->memos.memomax = params[0].is_pos_number_only() ? convertTo<int16>(params[0]) : 1;
else if (key.equals_ci("CHANCOUNT"))
@@ -890,15 +863,11 @@ class DBPlain : public Module
db << "NC " << nc->display << " " << nc->pass << endl;
- db << "MD LANGUAGE ";
- for (int j = 0; LangInfos[j].LanguageId != -1; ++j)
- if (nc->language == LangInfos[j].LanguageId)
- db << LangInfos[j].Name;
- db << endl;
-
db << "MD MEMOMAX " << nc->memos.memomax << endl;
db << "MD CHANCOUNT " << nc->channelcount << endl;
+ if (!nc->language.empty())
+ db << "MD LANGUAGE " << nc->language << endl;
if (!nc->email.empty())
db << "MD EMAIL " << nc->email << endl;
if (!nc->greet.empty())