diff options
author | Adam <Adam@anope.org> | 2014-06-23 07:12:41 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2014-06-23 07:12:41 -0400 |
commit | 148b26f687ce85dc01e852a2358b03d493757ada (patch) | |
tree | f81ea553d0384ec6063eff45cfaff5aa92aaa1c9 /modules/commands/cs_entrymsg.cpp | |
parent | 0dba0692f9f88275b7d89d511bf22124217bc4c6 (diff) |
Mostly working language string rewrite with new format strings
Diffstat (limited to 'modules/commands/cs_entrymsg.cpp')
-rw-r--r-- | modules/commands/cs_entrymsg.cpp | 60 |
1 files changed, 28 insertions, 32 deletions
diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 8e196d18b..41a8da517 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -106,11 +106,11 @@ class CommandEntryMessage : public Command if ((*messages)->empty()) { - source.Reply(_("Entry message list for \002%s\002 is empty."), ci->name.c_str()); + source.Reply(_("Entry message list for \002{0}\002 is empty."), ci->name); return; } - source.Reply(_("Entry message list for \002%s\002:"), ci->name.c_str()); + source.Reply(_("Entry message list for \002{0}\002:"), ci->name); ListFormatter list(source.GetAccount()); list.AddColumn(_("Number")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Message")); @@ -139,12 +139,12 @@ class CommandEntryMessage : public Command EntryMessageList *messages = ci->Require<EntryMessageList>("entrymsg"); if ((*messages)->size() >= Config->GetModule(this->owner)->Get<unsigned>("maxentries")) - source.Reply(_("The entry message list for \002%s\002 is full."), ci->name.c_str()); + source.Reply(_("The entry message list for \002{0}\002 is full."), ci->name); else { (*messages)->push_back(new EntryMsgImpl(ci, source.GetNick(), message)); Log(source.IsFounder(ci) ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to add a message"; - source.Reply(_("Entry message added to \002%s\002"), ci->name.c_str()); + source.Reply(_("Entry message added to \002{0}\002"), ci->name); } } @@ -153,9 +153,9 @@ class CommandEntryMessage : public Command EntryMessageList *messages = ci->Require<EntryMessageList>("entrymsg"); if (!message.is_pos_number_only()) - source.Reply(("Entry message \002%s\002 not found on channel \002%s\002."), message.c_str(), ci->name.c_str()); + source.Reply(("Entry message \002{0}\002 not found on channel \002{1}\002."), message, ci->name); else if ((*messages)->empty()) - source.Reply(_("Entry message list for \002%s\002 is empty."), ci->name.c_str()); + source.Reply(_("Entry message list for \002{0}\002 is empty."), ci->name); else { try @@ -167,14 +167,14 @@ class CommandEntryMessage : public Command if ((*messages)->empty()) ci->Shrink<EntryMessageList>("entrymsg"); Log(source.IsFounder(ci) ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove a message"; - source.Reply(_("Entry message \002%i\002 for \002%s\002 deleted."), i, ci->name.c_str()); + source.Reply(_("Entry message \002{0}\002 for \002{1]\002 deleted."), i, ci->name); } else throw ConvertException(); } catch (const ConvertException &) { - source.Reply(_("Entry message \002%s\002 not found on channel \002%s\002."), message.c_str(), ci->name.c_str()); + source.Reply(_("Entry message \002{0}\002 not found on channel \002{1}\002."), message, ci->name); } } } @@ -184,7 +184,7 @@ class CommandEntryMessage : public Command ci->Shrink<EntryMessageList>("entrymsg"); Log(source.IsFounder(ci) ? LOG_COMMAND : LOG_OVERRIDE, source, this, ci) << "to remove all messages"; - source.Reply(_("Entry messages for \002%s\002 have been cleared."), ci->name.c_str()); + source.Reply(_("Entry messages for \002{0}\002 have been cleared."), ci->name); } public: @@ -199,22 +199,24 @@ class CommandEntryMessage : public Command void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) override { - ChanServ::Channel *ci = ChanServ::Find(params[0]); + const Anope::string &chan = params[0]; + + ChanServ::Channel *ci = ChanServ::Find(chan); if (ci == NULL) { - source.Reply(CHAN_X_NOT_REGISTERED, params[0].c_str()); + source.Reply(_("Channel \002{0}\002 isn't registered."), chan); return; } if (Anope::ReadOnly && !params[1].equals_ci("LIST")) { - source.Reply(READ_ONLY_MODE); + source.Reply(_("Services are in read-only mode.")); return; } if (!source.IsFounder(ci) && !source.HasPriv("chanserv/administration")) { - source.Reply(ACCESS_DENIED); + source.Reply(_("Access denied. You do not have privilege \002{0}\002 on \002{1}\002."), "FOUNDER", ci->name); return; } @@ -234,25 +236,19 @@ class CommandEntryMessage : public Command bool OnHelp(CommandSource &source, const Anope::string &subcommand) override { - this->SendSyntax(source); - source.Reply(" "); - source.Reply(_("Controls what messages will be sent to users when they join the channel.")); - source.Reply(" "); - source.Reply(_("The \002ENTRYMSG ADD\002 command adds the given message to\n" - "the list of messages to be shown to users when they join\n" - "the channel.")); - source.Reply(" "); - source.Reply(_("The \002ENTRYMSG DEL\002 command removes the given message from\n" - "the list of messages to be shown to users when they join\n" - "the channel. You can remove the message by specifying its number\n" - "which you can get by listing the messages as explained below.")); - source.Reply(" "); - source.Reply(_("The \002ENTRYMSG LIST\002 command displays a listing of messages\n" - "to be shown to users when they join the channel.")); - source.Reply(" "); - source.Reply(_("The \002ENTRYMSG CLEAR\002 command clears all entries from\n" - "the list of messages to be shown to users when they join\n" - "the channel, effectively disabling entry messages.")); + source.Reply(_("Controls what messages will be sent to users when they join \037channel\037.\n" + "\n" + "The \002{0} ADD\002 command adds the given message to the list of messages to be shown to users when they join the channel.\n" + "\n" + "The \002{0} DEL\002 command removes the given message from the entry message list.\n" + " You can remove the message by specifying its number which you can get by listing the messages as explained below.\n" + "\n" + "The \002{0} LIST\002 command displays the list of messages on the entry message list.\n" + "\n" + "The \002{0} CLEAR\002 command clears the entry message list.\n" + "\n" + "Use of this command requires being the founder of \037channel\037."), + source.command); return true; } }; |