1
0
mirror of https://github.com/anope/anope.git synced 2026-07-10 09:03:13 +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
+153 -60
View File
@@ -32,15 +32,15 @@ class CommandBSKick : public Command
ChannelInfo *ci = source.ci;
if (readonly)
source.Reply(BOT_KICK_DISABLED);
source.Reply(_("Sorry, kicker configuration is temporarily disabled."));
else if (chan.empty() || option.empty() || value.empty())
SyntaxError(source, "KICK", BOT_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]"));
else if (!value.equals_ci("ON") && !value.equals_ci("OFF"))
SyntaxError(source, "KICK", BOT_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]"));
else if (!check_access(u, ci, CA_SET) && !u->Account()->HasPriv("botserv/administration"))
source.Reply(ACCESS_DENIED);
source.Reply(LanguageString::ACCESS_DENIED);
else if (!ci->bi)
source.Reply(BOT_NOT_ASSIGNED);
source.Reply(LanguageString::BOT_NOT_ASSIGNED);
else
{
bool override = !check_access(u, ci, CA_SET);
@@ -61,7 +61,7 @@ class CommandBSKick : public Command
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BADWORDS];
/* reset the value back to 0 - TSL */
ci->ttb[TTB_BADWORDS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -69,14 +69,17 @@ class CommandBSKick : public Command
ci->ttb[TTB_BADWORDS] = 0;
ci->botflags.SetFlag(BS_KICK_BADWORDS);
if (ci->ttb[TTB_BADWORDS])
source.Reply(BOT_KICK_BADWORDS_ON_BAN, ci->ttb[TTB_BADWORDS]);
source.Reply(_("Bot will now kick \002bad words\002, and will place a ban after \n"
"%d kicks for the same user. Use the BADWORDS command\n"
"to add or remove a bad word."), ci->ttb[TTB_BADWORDS]);
else
source.Reply(BOT_KICK_BADWORDS_ON);
source.Reply(_("Bot will now kick \002bad words\002. Use the BADWORDS command\n"
"to add or remove a bad word."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_BADWORDS);
source.Reply(BOT_KICK_BADWORDS_OFF);
source.Reply(_("Bot won't kick \002bad words\002 anymore."));
}
}
else if (option.equals_ci("BOLDS"))
@@ -91,7 +94,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_BOLDS];
ci->ttb[TTB_BOLDS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -99,14 +102,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_BOLDS] = 0;
ci->botflags.SetFlag(BS_KICK_BOLDS);
if (ci->ttb[TTB_BOLDS])
source.Reply(BOT_KICK_BOLDS_ON_BAN, ci->ttb[TTB_BOLDS]);
source.Reply(_("Bot will now kick \002bolds\002, and will place a ban after\n%d kicks to the same user."), ci->ttb[TTB_BOLDS]);
else
source.Reply(BOT_KICK_BOLDS_ON);
source.Reply(_("Bot will now kick \002bolds\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_BOLDS);
source.Reply(BOT_KICK_BOLDS_OFF);
source.Reply(_("Bot won't kick \002bolds\002 anymore."));
}
}
else if (option.equals_ci("CAPS"))
@@ -124,7 +127,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_CAPS];
ci->ttb[TTB_CAPS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -147,14 +150,17 @@ class CommandBSKick : public Command
ci->botflags.SetFlag(BS_KICK_CAPS);
if (ci->ttb[TTB_CAPS])
source.Reply(BOT_KICK_CAPS_ON_BAN, ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]);
source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n"
"%d characters and %d%% of the entire message), and will \n"
"place a ban after %d kicks for the same user."), ci->capsmin, ci->capspercent, ci->ttb[TTB_CAPS]);
else
source.Reply(BOT_KICK_CAPS_ON, ci->capsmin, ci->capspercent);
source.Reply(_("Bot will now kick \002caps\002 (they must constitute at least\n"
"%d characters and %d%% of the entire message)."), ci->capsmin, ci->capspercent);
}
else
{
ci->botflags.UnsetFlag(BS_KICK_CAPS);
source.Reply(BOT_KICK_CAPS_OFF);
source.Reply(_("Bot won't kick \002caps\002 anymore."));
}
}
else if (option.equals_ci("COLORS"))
@@ -169,7 +175,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_COLORS];
ci->ttb[TTB_COLORS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -177,14 +183,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_COLORS] = 0;
ci->botflags.SetFlag(BS_KICK_COLORS);
if (ci->ttb[TTB_COLORS])
source.Reply(BOT_KICK_COLORS_ON_BAN, ci->ttb[TTB_COLORS]);
source.Reply(_("Bot will now kick \002colors\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_COLORS]);
else
source.Reply(BOT_KICK_COLORS_ON);
source.Reply(_("Bot will now kick \002colors\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_COLORS);
source.Reply(BOT_KICK_COLORS_OFF);
source.Reply(_("Bot won't kick \002colors\002 anymore."));
}
}
else if (option.equals_ci("FLOOD"))
@@ -202,7 +208,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_FLOOD];
ci->ttb[TTB_FLOOD] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -225,14 +231,14 @@ class CommandBSKick : public Command
ci->botflags.SetFlag(BS_KICK_FLOOD);
if (ci->ttb[TTB_FLOOD])
source.Reply(BOT_KICK_FLOOD_ON_BAN, ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]);
source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds and\nwill place a ban after %d kicks for the same user."), ci->floodlines, ci->floodsecs, ci->ttb[TTB_FLOOD]);
else
source.Reply(BOT_KICK_FLOOD_ON, ci->floodlines, ci->floodsecs);
source.Reply(_("Bot will now kick \002flood\002 (%d lines in %d seconds)."), ci->floodlines, ci->floodsecs);
}
else
{
ci->botflags.UnsetFlag(BS_KICK_FLOOD);
source.Reply(BOT_KICK_FLOOD_OFF);
source.Reply(_("Bot won't kick \002flood\002 anymore."));
}
}
else if (option.equals_ci("REPEAT"))
@@ -249,7 +255,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REPEAT];
ci->ttb[TTB_REPEAT] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -265,14 +271,17 @@ class CommandBSKick : public Command
ci->botflags.SetFlag(BS_KICK_REPEAT);
if (ci->ttb[TTB_REPEAT])
source.Reply(BOT_KICK_REPEAT_ON_BAN, ci->repeattimes, ci->ttb[TTB_REPEAT]);
source.Reply(_("Bot will now kick \002repeats\002 (users that say %d times\n"
"the same thing), and will place a ban after %d \n"
"kicks for the same user."), ci->repeattimes, ci->ttb[TTB_REPEAT]);
else
source.Reply(BOT_KICK_REPEAT_ON, ci->repeattimes);
source.Reply(_("Bot will now kick \002repeats\002 (users that say %d times\n"
"the same thing)."), ci->repeattimes);
}
else
{
ci->botflags.UnsetFlag(BS_KICK_REPEAT);
source.Reply(BOT_KICK_REPEAT_OFF);
source.Reply(_("Bot won't kick \002repeats\002 anymore."));
}
}
else if (option.equals_ci("REVERSES"))
@@ -287,7 +296,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_REVERSES];
ci->ttb[TTB_REVERSES] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -295,14 +304,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_REVERSES] = 0;
ci->botflags.SetFlag(BS_KICK_REVERSES);
if (ci->ttb[TTB_REVERSES])
source.Reply(BOT_KICK_REVERSES_ON_BAN, ci->ttb[TTB_REVERSES]);
source.Reply(_("Bot will now kick \002reverses\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_REVERSES]);
else
source.Reply(BOT_KICK_REVERSES_ON);
source.Reply(_("Bot will now kick \002reverses\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_REVERSES);
source.Reply(BOT_KICK_REVERSES_OFF);
source.Reply(_("Bot won't kick \002reverses\002 anymore."));
}
}
else if (option.equals_ci("UNDERLINES"))
@@ -317,7 +326,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_UNDERLINES];
ci->ttb[TTB_UNDERLINES] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -325,14 +334,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_UNDERLINES] = 0;
ci->botflags.SetFlag(BS_KICK_UNDERLINES);
if (ci->ttb[TTB_UNDERLINES])
source.Reply(BOT_KICK_UNDERLINES_ON_BAN, ci->ttb[TTB_UNDERLINES]);
source.Reply(_("Bot will now kick \002underlines\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_UNDERLINES]);
else
source.Reply(BOT_KICK_UNDERLINES_ON);
source.Reply(_("Bot will now kick \002underlines\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_UNDERLINES);
source.Reply(BOT_KICK_UNDERLINES_OFF);
source.Reply(_("Bot won't kick \002underlines\002 anymore."));
}
}
else if (option.equals_ci("ITALICS"))
@@ -347,7 +356,7 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
ci->ttb[TTB_ITALICS] = 0;
source.Reply(BOT_KICK_BAD_TTB, ttb.c_str());
source.Reply(_("\002%s\002 cannot be taken as times to ban."), ttb.c_str());
return MOD_CONT;
}
}
@@ -355,14 +364,14 @@ class CommandBSKick : public Command
ci->ttb[TTB_ITALICS] = 0;
ci->botflags.SetFlag(BS_KICK_ITALICS);
if (ci->ttb[TTB_ITALICS])
source.Reply(BOT_KICK_ITALICS_ON_BAN, ci->ttb[TTB_ITALICS]);
source.Reply(_("Bot will now kick \002italics\002, and will place a ban after\n%d kicks for the same user."), ci->ttb[TTB_ITALICS]);
else
source.Reply(BOT_KICK_ITALICS_ON);
source.Reply(_("Bot will now kick \002italics\002."));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_ITALICS);
source.Reply(BOT_KICK_ITALICS_OFF);
source.Reply(_("Bot won't kick \002italics\002 anymore."));
}
}
else if (option.equals_ci("AMSGS"))
@@ -377,7 +386,6 @@ class CommandBSKick : public Command
{
Log(LOG_DEBUG) << "remainder of ttb " << error << " ttb " << ci->ttb[TTB_ITALICS];
ci->ttb[TTB_AMSGS] = 0;
source.Reply(BOT_KICK_AMSGS_ON_BAN, ci->ttb[TTB_AMSGS]);
return MOD_CONT;
}
}
@@ -385,18 +393,18 @@ class CommandBSKick : public Command
ci->ttb[TTB_AMSGS] = 0;
ci->botflags.SetFlag(BS_KICK_AMSGS);
if (ci->ttb[TTB_AMSGS])
source.Reply(BOT_KICK_AMSGS_ON_BAN, ci->ttb[TTB_AMSGS]);
source.Reply(_("Bot will now kick for \002amsgs\002, and will place a ban after %d\nkicks for the same user."), ci->ttb[TTB_AMSGS]);
else
source.Reply(BOT_KICK_AMSGS_ON);
source.Reply(_("Bot will now kick for \002amsgs\002"));
}
else
{
ci->botflags.UnsetFlag(BS_KICK_AMSGS);
source.Reply(BOT_KICK_AMSGS_OFF);
source.Reply(_("Bot won't kick for \002amsgs\002 anymore."));
}
}
else
source.Reply(BOT_KICK_UNKNOWN, option.c_str());
source.Reply(LanguageString::UNKNOWN_OPTION, option.c_str(), this->name.c_str());
}
return MOD_CONT;
}
@@ -404,27 +412,112 @@ class CommandBSKick : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand)
{
if (subcommand.empty())
source.Reply(BOT_HELP_KICK);
source.Reply(_("Syntax: \002KICK \037channel\037 \037option\037 \037parameters\037\002\n"
" \n"
"Configures bot kickers. \037option\037 can be one of:\n"
" \n"
" AMSGS Sets if the bot kicks for amsgs\n"
" BOLDS Sets if the bot kicks bolds\n"
" BADWORDS Sets if the bot kicks bad words\n"
" CAPS Sets if the bot kicks caps\n"
" COLORS Sets if the bot kicks colors\n"
" FLOOD Sets if the bot kicks flooding users\n"
" REPEAT Sets if the bot kicks users who repeat\n"
" themselves\n"
" REVERSES Sets if the bot kicks reverses\n"
" UNDERLINES Sets if the bot kicks underlines\n"
" ITALICS Sets if the bot kicks italics\n"
" \n"
"Type \002%R%S HELP KICK \037option\037\002 for more information\n"
"on a specific option.\n"
" \n"
"Note: access to this command is controlled by the\n"
"level SET."));
else if (subcommand.equals_ci("BADWORDS"))
source.Reply(BOT_HELP_KICK_BADWORDS);
source.Reply(_("Syntax: \002KICK \037#channel\037 BADWORDS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the bad words kicker on or off. When enabled, this\n"
"option tells the bot to kick users who say certain words\n"
"on the channels.\n"
"You can define bad words for your channel using the\n"
"\002BADWORDS\002 command. Type \002%R%S HELP BADWORDS\002 for\n"
"more information.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("BOLDS"))
source.Reply(BOT_HELP_KICK_BOLDS);
source.Reply(_("Syntax: \002KICK \037channel\037 BOLDS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the bolds kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use bolds.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("CAPS"))
source.Reply(BOT_HELP_KICK_CAPS);
source.Reply(_("Syntax: \002KICK \037channel\037 CAPS {\037ON|OFF\037} [\037ttb\037 [\037min\037 [\037percent\037]]]\002\n"
"Sets the caps kicker on or off. When enabled, this\n"
"option tells the bot to kick users who are talking in\n"
"CAPS.\n"
"The bot kicks only if there are at least \002min\002 caps\n"
"and they constitute at least \002percent\002%% of the total \n"
"text line (if not given, it defaults to 10 characters\n"
"and 25%%).\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("COLORS"))
source.Reply(BOT_HELP_KICK_COLORS);
source.Reply(_("Syntax: \002KICK \037channel\037 COLORS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the colors kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use colors.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("FLOOD"))
source.Reply(BOT_HELP_KICK_FLOOD);
source.Reply(_("Syntax: \002KICK \037channel\037 FLOOD {\037ON|OFF\037} [\037ttb\037 [\037ln\037 [\037secs\037]]]\002\n"
"Sets the flood kicker on or off. When enabled, this\n"
"option tells the bot to kick users who are flooding\n"
"the channel using at least \002ln\002 lines in \002secs\002 seconds\n"
"(if not given, it defaults to 6 lines in 10 seconds).\n"
" \n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("REPEAT"))
source.Reply(BOT_HELP_KICK_REPEAT);
source.Reply(_("Syntax: \002KICK \037#channel\037 REPEAT {\037ON|OFF\037} [\037ttb\037 [\037num\037]]\002\n"
"Sets the repeat kicker on or off. When enabled, this\n"
"option tells the bot to kick users who are repeating\n"
"themselves \002num\002 times (if num is not given, it\n"
"defaults to 3).\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("REVERSES"))
source.Reply(BOT_HELP_KICK_REVERSES);
source.Reply(_("Syntax: \002KICK \037channel\037 REVERSES {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the reverses kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use reverses.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("UNDERLINES"))
source.Reply(BOT_HELP_KICK_UNDERLINES);
source.Reply(_("Syntax: \002KICK \037channel\037 UNDERLINES {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the underlines kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use underlines.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("ITALICS"))
source.Reply(BOT_HELP_KICK_ITALICS);
source.Reply(_("Syntax: \002KICK \037channel\037 ITALICS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the italics kicker on or off. When enabled, this\n"
"option tells the bot to kick users who use italics.\n"
"ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else if (subcommand.equals_ci("AMSGS"))
source.Reply(BOT_HELP_KICK_AMSGS);
source.Reply(_("Syntax: \002KICK \037channel\037 AMSGS {\037ON|OFF\037} [\037ttb\037]\002\n"
"Sets the amsg kicker on or off. When enabled, the bot will\n"
"kick users who send the same message to multiple channels\n"
"where BotServ bots are.\n"
"Ttb is the number of times a user can be kicked\n"
"before it get banned. Don't give ttb to disable\n"
"the ban system once activated."));
else
return false;
@@ -433,12 +526,12 @@ class CommandBSKick : public Command
void OnSyntaxError(CommandSource &source, const Anope::string &subcommand)
{
SyntaxError(source, "KICK", BOT_KICK_SYNTAX);
SyntaxError(source, "KICK", _("KICK \037channel\037 \037option\037 {\037ON|\037} [\037settings\037]"));
}
void OnServHelp(CommandSource &source)
{
source.Reply(BOT_HELP_CMD_KICK);
source.Reply(_(" KICK Configures kickers"));
}
};
@@ -474,7 +567,7 @@ class BSKick : public Module
if (c->ci != NULL && c->ci->botflags.HasFlag(BS_KICK_AMSGS))
{
check_ban(c->ci, u, TTB_AMSGS);
bot_kick(c->ci, u, BOT_REASON_AMSGS);
bot_kick(c->ci, u, _("Don't use AMSGs!"));
}
}