1
0
mirror of https://github.com/anope/anope.git synced 2026-07-05 11:03:12 +02:00

Moved the language strings which are only used once

out of the core and into the modules that use them.
This commit is contained in:
Adam
2011-02-04 15:30:31 -05:00
parent c362a1e077
commit 08583dc107
226 changed files with 42289 additions and 45412 deletions
+33 -20
View File
@@ -34,13 +34,13 @@ class CommandNSSet : public Command
if (readonly)
{
source.Reply(NICK_SET_DISABLED);
source.Reply(LanguageString::NICK_SET_DISABLED);
return MOD_CONT;
}
if (u->Account()->HasFlag(NI_SUSPENDED))
{
source.Reply(NICK_X_SUSPENDED, u->Account()->display.c_str());
source.Reply(LanguageString::NICK_X_SUSPENDED, u->Account()->display.c_str());
return MOD_CONT;
}
@@ -59,7 +59,7 @@ class CommandNSSet : public Command
mod_run_cmd(NickServ, u, c, params[0], cmdparams, false);
}
else
source.Reply(NICK_SET_UNKNOWN_OPTION, params[0].c_str());
source.Reply(LanguageString::NICK_SET_UNKNOWN_OPTION, params[0].c_str());
return MOD_CONT;
}
@@ -68,10 +68,17 @@ class CommandNSSet : public Command
{
if (subcommand.empty())
{
source.Reply(NICK_HELP_SET_HEAD);
source.Reply(_("Syntax: \002SET \037option\037 \037parameters\037\002\n"
" \n"
"Sets various nickname options. \037option\037 can be one of:"));
for (subcommand_map::iterator it = this->subcommands.begin(), it_end = this->subcommands.end(); it != it_end; ++it)
it->second->OnServHelp(source);
source.Reply(NICK_HELP_SET_TAIL);
source.Reply(_("In order to use this command, you must first identify\n"
"with your password (\002%R%S HELP IDENTIFY\002 for more\n"
"information).\n"
" \n"
"Type \002%R%S HELP SET \037option\037\002 for more information\n"
"on a specific option."));
return true;
}
else
@@ -87,12 +94,12 @@ class CommandNSSet : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "SET", NICK_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::NICK_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(NICK_HELP_CMD_SET);
source.Reply(_(" SET Set options, including kill protection"));
}
bool AddSubcommand(Module *creator, Command *c)
@@ -132,30 +139,33 @@ class CommandNSSetDisplay : public Command
if (!na || na->nc != u->Account())
{
source.Reply(NICK_SASET_DISPLAY_INVALID, u->Account()->display.c_str());
source.Reply(LanguageString::NICK_SASET_DISPLAY_INVALID, u->Account()->display.c_str());
return MOD_CONT;
}
change_core_display(u->Account(), params[1]);
source.Reply(NICK_SET_DISPLAY_CHANGED, u->Account()->display.c_str());
source.Reply(LanguageString::NICK_SET_DISPLAY_CHANGED, u->Account()->display.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(NICK_HELP_SET_DISPLAY);
source.Reply(_("Syntax: \002SET DISPLAY \037new-display\037\002\n"
" \n"
"Changes the display used to refer to your nickname group in \n"
"Services. The new display MUST be a nick of your group."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SET", NICK_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::NICK_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(NICK_HELP_CMD_SET_DISPLAY);
source.Reply(_(" DISPLAY Set the display of your group in Services"));
}
};
@@ -175,46 +185,49 @@ class CommandNSSetPassword : public Command
if (u->Account()->display.equals_ci(param) || (Config->StrictPasswords && len < 5))
{
source.Reply(MORE_OBSCURE_PASSWORD);
source.Reply(LanguageString::MORE_OBSCURE_PASSWORD);
return MOD_CONT;
}
else if (len > Config->PassLen)
{
source.Reply(PASSWORD_TOO_LONG);
source.Reply(LanguageString::PASSWORD_TOO_LONG);
return MOD_CONT;
}
if (enc_encrypt(param, u->Account()->pass) < 0)
{
Log(NickServ) << "Failed to encrypt password for " << u->Account()->display << " (set)";
source.Reply(NICK_SASET_PASSWORD_FAILED);
source.Reply(LanguageString::NICK_SASET_PASSWORD_FAILED);
return MOD_CONT;
}
Anope::string tmp_pass;
if (enc_decrypt(u->Account()->pass, tmp_pass) == 1)
source.Reply(NICK_SASET_PASSWORD_CHANGED_TO, u->Account()->display.c_str(), tmp_pass.c_str());
source.Reply(LanguageString::NICK_SASET_PASSWORD_CHANGED_TO, u->Account()->display.c_str(), tmp_pass.c_str());
else
source.Reply(NICK_SASET_PASSWORD_CHANGED, u->Account()->display.c_str());
source.Reply(LanguageString::NICK_SASET_PASSWORD_CHANGED, u->Account()->display.c_str());
return MOD_CONT;
}
bool OnHelp(CommandSource &source, const Anope::string &)
{
source.Reply(NICK_HELP_SET_PASSWORD);
source.Reply(_("Syntax: \002SET PASSWORD \037new-password\037\002\n"
" \n"
"Changes the password used to identify you as the nick's\n"
"owner."));
return true;
}
void OnSyntaxError(CommandSource &source, const Anope::string &)
{
// XXX
SyntaxError(source, "SET", NICK_SET_SYNTAX);
SyntaxError(source, "SET", LanguageString::NICK_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(NICK_HELP_CMD_SET_PASSWORD);
source.Reply(_(" PASSWORD Set your nickname password"));
}
};