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

cs_akick: Make the default autokick reason translatable.

os_forbid: It is required to specify a reason.
This commit is contained in:
Robby-
2013-09-28 20:44:57 +02:00
committed by Adam
parent a04c320b4b
commit 2a5e8f1890
2 changed files with 10 additions and 18 deletions
+6 -5
View File
@@ -464,6 +464,7 @@ class CommandCSAKick : public Command
bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override
{
BotInfo *bi = Config->GetClient("NickServ");
this->SendSyntax(source);
source.Reply(" ");
source.Reply(_("Maintains the \002AutoKick list\002 for a channel. If a user\n"
@@ -474,12 +475,12 @@ class CommandCSAKick : public Command
"The \002AKICK ADD\002 command adds the given nick or usermask\n"
"to the AutoKick list. If a \037reason\037 is given with\n"
"the command, that reason will be used when the user is\n"
"kicked; if not, the default reason is \"You have been\n"
"kicked; if not, the default reason is \"User has been\n"
"banned from the channel\".\n"
"When akicking a \037registered nick\037 the nickserv account\n"
"When akicking a \037registered nick\037 the %s account\n"
"will be added to the akick list instead of the mask.\n"
"All users within that nickgroup will then be akicked.\n"),
source.service->nick.c_str());
source.service->nick.c_str(), bi ? bi->nick.c_str() : "NickServ");
source.Reply(_(
" \n"
"The \002AKICK DEL\002 command removes the given nick or mask\n"
@@ -542,9 +543,9 @@ class CSAKick : public Module
mask = autokick->mask;
reason = autokick->reason;
if (reason.empty())
reason = Config->GetModule(this)->Get<const Anope::string>("autokickreason");
reason = Language::Translate(u, Config->GetModule(this)->Get<const Anope::string>("autokickreason").c_str());
if (reason.empty())
reason = "User has been banned from the channel";
reason = Language::Translate(u, _("User has been banned from the channel"));
return EVENT_STOP;
}
}
+4 -13
View File
@@ -92,7 +92,7 @@ class CommandOSForbid : public Command
CommandOSForbid(Module *creator) : Command(creator, "operserv/forbid", 1, 5), fs("ForbidService", "forbid")
{
this->SetDesc(_("Forbid usage of nicknames, channels, and emails"));
this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037 [\037reason\037]"));
this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037 \037reason\037"));
this->SetSyntax(_("DEL {NICK|CHAN|EMAIL|REGISTER} \037entry\037"));
this->SetSyntax("LIST [NICK|CHAN|EMAIL|REGISTER]");
}
@@ -236,10 +236,7 @@ class CommandOSForbid : public Command
if (u->server == Me || u->HasMode("OPER"))
continue;
if (d->reason.empty())
reason = Language::Translate(u, _("This channel has been forbidden."));
else
reason = Anope::printf(Language::Translate(u, _("This channel has been forbidden: %s")), d->reason.c_str());
reason = Anope::printf(Language::Translate(u, _("This channel has been forbidden: %s")), d->reason.c_str());
c->Kick(source.service, u, "%s", reason.c_str());
}
@@ -400,10 +397,7 @@ class OSForbid : public Module
BotInfo *OperServ = Config->GetClient("OperServ");
if (OperServ)
{
if (d->reason.empty())
u->SendMessage(OperServ, _("This nickname has been forbidden."));
else
u->SendMessage(OperServ, _("This nickname has been forbidden: %s"), d->reason.c_str());
u->SendMessage(OperServ, _("This nickname has been forbidden: %s"), d->reason.c_str());
}
if (nickserv)
nickserv->Collide(u, NULL);
@@ -431,10 +425,7 @@ class OSForbid : public Module
chanserv->Hold(c);
}
if (d->reason.empty())
reason = Language::Translate(u, _("This channel has been forbidden."));
else
reason = Anope::printf(Language::Translate(u, _("This channel has been forbidden: %s")), d->reason.c_str());
reason = Anope::printf(Language::Translate(u, _("This channel has been forbidden: %s")), d->reason.c_str());
return EVENT_STOP;
}