diff options
author | Robby- <robby@chat.be> | 2013-09-22 23:27:14 +0200 |
---|---|---|
committer | Adam <Adam@anope.org> | 2013-09-27 19:11:02 -0400 |
commit | bf67b9ee5caee3224a44f3999a3f7f78fbce0a25 (patch) | |
tree | a8860f1eff4a110b6837a6068b0d684cec09ff53 | |
parent | 829c169063577eefb50f2b6961f91f8bf29ae29d (diff) |
Make column titles in listings translatable.
Make some more strings translatable, and remove some that don't need translation at all.
Make expirytimes and units translatable.
Make predefined messages in listings also translatable.
Make the remaining command descriptions translatable.
Make some ns/cs info strings equal to dedupe in translation file. Add missing no-autoop setting to cs info output. Make some strings translatable.
47 files changed, 169 insertions, 161 deletions
diff --git a/modules/commands/bs_badwords.cpp b/modules/commands/bs_badwords.cpp index b654ae12f..41cfb7f4c 100644 --- a/modules/commands/bs_badwords.cpp +++ b/modules/commands/bs_badwords.cpp @@ -190,7 +190,7 @@ class CommandBSBadwords : public Command ListFormatter list(source.GetAccount()); BadWords *bw = ci->GetExt<BadWords>("badwords"); - list.AddColumn("Number").AddColumn("Word").AddColumn("Type"); + list.AddColumn(_("Number")).AddColumn(_("Word")).AddColumn(_("Type")); if (!bw || !bw->GetBadWordCount()) { diff --git a/modules/commands/bs_botlist.cpp b/modules/commands/bs_botlist.cpp index b45f8bda7..d6ae463ab 100644 --- a/modules/commands/bs_botlist.cpp +++ b/modules/commands/bs_botlist.cpp @@ -24,7 +24,7 @@ class CommandBSBotList : public Command unsigned count = 0; ListFormatter list(source.GetAccount()); - list.AddColumn("Nick").AddColumn("Mask"); + list.AddColumn(_("Nick")).AddColumn(_("Mask")); for (botinfo_map::const_iterator it = BotListByNick->begin(), it_end = BotListByNick->end(); it != it_end; ++it) { diff --git a/modules/commands/bs_info.cpp b/modules/commands/bs_info.cpp index a3eb9ce2d..9cd01ebf0 100644 --- a/modules/commands/bs_info.cpp +++ b/modules/commands/bs_info.cpp @@ -56,7 +56,7 @@ class CommandBSInfo : public Command source.Reply(_("Information for bot \002%s\002:"), bi->nick.c_str()); info[_("Mask")] = bi->GetIdent() + "@" + bi->host; info[_("Real name")] = bi->realname; - info[_("Created")] = Anope::strftime(bi->created); + info[_("Created")] = Anope::strftime(bi->created, source.GetAccount()); info[_("Options")] = bi->oper_only ? _("Private") : _("None"); info[_("Used on")] = stringify(bi->GetChannelCount()) + " channel(s)"; diff --git a/modules/commands/bs_kick.cpp b/modules/commands/bs_kick.cpp index 1d7563c38..b0ff8b26e 100644 --- a/modules/commands/bs_kick.cpp +++ b/modules/commands/bs_kick.cpp @@ -1184,9 +1184,9 @@ class BSKick : public Module info[_("AMSG kicker")] = disabled; if (kd && kd->dontkickops) - info.AddOption(_("Ops Protection")); + info.AddOption(_("Ops protection")); if (kd && kd->dontkickvoices) - info.AddOption(_("Voices Protection")); + info.AddOption(_("Voices protection")); } void OnPrivmsg(User *u, Channel *c, Anope::string &msg) anope_override diff --git a/modules/commands/cs_access.cpp b/modules/commands/cs_access.cpp index 414704722..91f9cff4f 100644 --- a/modules/commands/cs_access.cpp +++ b/modules/commands/cs_access.cpp @@ -426,7 +426,7 @@ class CommandCSAccess : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Level").AddColumn("Mask"); + list.AddColumn(_("Number")).AddColumn(_("Level")).AddColumn(_("Mask")); this->ProcessList(source, ci, params, list); } @@ -439,7 +439,7 @@ class CommandCSAccess : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Level").AddColumn("Mask").AddColumn("By").AddColumn("Last seen"); + list.AddColumn(_("Number")).AddColumn(_("Level")).AddColumn(_("Mask")).AddColumn(_("By")).AddColumn(_("Last seen")); this->ProcessList(source, ci, params, list); } @@ -661,7 +661,7 @@ class CommandCSLevels : public Command source.Reply(_("Access level settings for channel %s:"), ci->name.c_str()); ListFormatter list(source.GetAccount()); - list.AddColumn("Name").AddColumn("Level"); + list.AddColumn(_("Name")).AddColumn(_("Level")); const std::vector<Privilege> &privs = PrivilegeManager::GetPrivileges(); @@ -674,9 +674,9 @@ class CommandCSLevels : public Command entry["Name"] = p.name; if (j == ACCESS_INVALID) - entry["Level"] = "(disabled)"; + entry["Level"] = Language::Translate(source.GetAccount(), _("(disabled)")); else if (j == ACCESS_FOUNDER) - entry["Level"] = "(founder only)"; + entry["Level"] = Language::Translate(source.GetAccount(), _("(founder only)")); else entry["Level"] = stringify(j); @@ -755,7 +755,7 @@ class CommandCSLevels : public Command source.Reply(_("The following feature/function names are available:")); ListFormatter list(source.GetAccount()); - list.AddColumn("Name").AddColumn("Description"); + list.AddColumn(_("Name")).AddColumn(_("Description")); const std::vector<Privilege> &privs = PrivilegeManager::GetPrivileges(); for (unsigned i = 0; i < privs.size(); ++i) diff --git a/modules/commands/cs_akick.cpp b/modules/commands/cs_akick.cpp index 06ddc406e..2a0d623af 100644 --- a/modules/commands/cs_akick.cpp +++ b/modules/commands/cs_akick.cpp @@ -257,11 +257,12 @@ class CommandCSAKick : public Command { class AkickListCallback : public NumberList { + CommandSource &source; ListFormatter &list; ChannelInfo *ci; public: - AkickListCallback(ListFormatter &_list, ChannelInfo *_ci, const Anope::string &numlist) : NumberList(numlist, false), list(_list), ci(_ci) + AkickListCallback(CommandSource &_source, ListFormatter &_list, ChannelInfo *_ci, const Anope::string &numlist) : NumberList(numlist, false), source(_source), list(_list), ci(_ci) { } @@ -274,11 +275,11 @@ class CommandCSAKick : public Command Anope::string timebuf, lastused; if (akick->addtime) - timebuf = Anope::strftime(akick->addtime, NULL, false); + timebuf = Anope::strftime(akick->addtime, source.GetAccount(), false); else timebuf = UNKNOWN; if (akick->last_used) - lastused = Anope::strftime(akick->last_used, NULL, false); + lastused = Anope::strftime(akick->last_used, source.GetAccount(), false); else lastused = UNKNOWN; @@ -295,7 +296,7 @@ class CommandCSAKick : public Command this->list.AddEntry(entry); } } - nl_list(list, ci, mask); + nl_list(source, list, ci, mask); nl_list.Process(); } else @@ -314,11 +315,11 @@ class CommandCSAKick : public Command Anope::string timebuf, lastused; if (akick->addtime) - timebuf = Anope::strftime(akick->addtime); + timebuf = Anope::strftime(akick->addtime, source.GetAccount()); else timebuf = UNKNOWN; if (akick->last_used) - lastused = Anope::strftime(akick->last_used); + lastused = Anope::strftime(akick->last_used, source.GetAccount()); else lastused = UNKNOWN; @@ -361,7 +362,7 @@ class CommandCSAKick : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Reason")); this->ProcessList(source, ci, params, list); } @@ -374,7 +375,7 @@ class CommandCSAKick : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("Creator").AddColumn("Created").AddColumn("Last used").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Last used")).AddColumn(_("Reason")); this->ProcessList(source, ci, params, list); } diff --git a/modules/commands/cs_drop.cpp b/modules/commands/cs_drop.cpp index e0b40a9d5..86061dc91 100644 --- a/modules/commands/cs_drop.cpp +++ b/modules/commands/cs_drop.cpp @@ -39,7 +39,7 @@ class CommandCSDrop : public Command if (params.size() < 2 || !chan.equals_ci(params[1])) { - source.Reply(_("You must enter the channel name twice as a confirmation that you wish to drop \2%s\2."), chan.c_str()); + source.Reply(_("You must enter the channel name twice as a confirmation that you wish to drop \002%s\002."), chan.c_str()); return; } diff --git a/modules/commands/cs_entrymsg.cpp b/modules/commands/cs_entrymsg.cpp index 1aeadaac8..3cf14e523 100644 --- a/modules/commands/cs_entrymsg.cpp +++ b/modules/commands/cs_entrymsg.cpp @@ -110,7 +110,7 @@ class CommandEntryMessage : public Command source.Reply(_("Entry message list for \002%s\002:"), ci->name.c_str()); ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Creator").AddColumn("Created").AddColumn("Message"); + list.AddColumn(_("Number")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Message")); for (unsigned i = 0; i < (*messages)->size(); ++i) { EntryMsg *msg = (*messages)->at(i); @@ -118,7 +118,7 @@ class CommandEntryMessage : public Command ListFormatter::ListEntry entry; entry["Number"] = stringify(i + 1); entry["Creator"] = msg->creator; - entry["Created"] = Anope::strftime(msg->when); + entry["Created"] = Anope::strftime(msg->when, source.GetAccount()); entry["Message"] = msg->message; list.AddEntry(entry); } diff --git a/modules/commands/cs_flags.cpp b/modules/commands/cs_flags.cpp index 984c0089c..05129ad05 100644 --- a/modules/commands/cs_flags.cpp +++ b/modules/commands/cs_flags.cpp @@ -249,9 +249,9 @@ class CommandCSFlags : public Command if (p != NULL) { if (add) - source.Reply(_("Privilege \2%s\2 added to \2%s\2 on \2%s\2, new flags are +\2%s\2"), p->name.c_str(), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str()); + source.Reply(_("Privilege \002%s\002 added to \002%s\002 on \002%s\002, new flags are +\002%s\002"), p->name.c_str(), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str()); else - source.Reply(_("Privilege \2%s\2 removed from \2%s\2 on \2%s\2, new flags are +\2%s\2"), p->name.c_str(), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str()); + source.Reply(_("Privilege \002%s\002 removed from \002%s\002 on \002%s\002, new flags are +\002%s\002"), p->name.c_str(), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str()); } else source.Reply(_("Flags for \002%s\002 on %s set to +\002%s\002"), access->mask.c_str(), ci->name.c_str(), access->AccessSerialize().c_str()); @@ -269,7 +269,7 @@ class CommandCSFlags : public Command ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("Flags").AddColumn("Creator").AddColumn("Created"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Flags")).AddColumn(_("Creator")).AddColumn(_("Created")); unsigned count = 0; for (unsigned i = 0, end = ci->GetAccessCount(); i < end; ++i) diff --git a/modules/commands/cs_info.cpp b/modules/commands/cs_info.cpp index 8f910fc83..a52c43d87 100644 --- a/modules/commands/cs_info.cpp +++ b/modules/commands/cs_info.cpp @@ -44,20 +44,20 @@ class CommandCSInfo : public Command source.Reply(CHAN_INFO_HEADER, chan.c_str()); if (ci->GetFounder()) - info["Founder"] = ci->GetFounder()->display; + info[_("Founder")] = ci->GetFounder()->display; if (show_all && ci->GetSuccessor()) - info["Successor"] = ci->GetSuccessor()->display; + info[_("Successor")] = ci->GetSuccessor()->display; if (!ci->desc.empty()) - info["Description"] = ci->desc; + info[_("Description")] = ci->desc; - info["Registered"] = Anope::strftime(ci->time_registered); - info["Last used"] = Anope::strftime(ci->last_used); + info[_("Registered")] = Anope::strftime(ci->time_registered, source.GetAccount()); + info[_("Last used")] = Anope::strftime(ci->last_used, source.GetAccount()); if (show_all) { - info["Ban type"] = stringify(ci->bantype); + info[_("Ban type")] = stringify(ci->bantype); } FOREACH_MOD(OnChanInfo, (source, ci, info, show_all)); diff --git a/modules/commands/cs_list.cpp b/modules/commands/cs_list.cpp index 661c54ac6..ef9f86dd4 100644 --- a/modules/commands/cs_list.cpp +++ b/modules/commands/cs_list.cpp @@ -71,7 +71,7 @@ class CommandCSList : public Command source.Reply(_("List of entries matching \002%s\002:"), pattern.c_str()); ListFormatter list(source.GetAccount()); - list.AddColumn("Name").AddColumn("Description"); + list.AddColumn(_("Name")).AddColumn(_("Description")); Anope::map<ChannelInfo *> ordered_map; for (registered_channel_map::const_iterator it = RegisteredChannelList->begin(), it_end = RegisteredChannelList->end(); it != it_end; ++it) @@ -99,7 +99,7 @@ class CommandCSList : public Command ListFormatter::ListEntry entry; entry["Name"] = (isnoexpire ? "!" : "") + ci->name; if (ci->HasExt("CS_SUSPENDED")) - entry["Description"] = "[Suspended]"; + entry["Description"] = Language::Translate(source.GetAccount(), _("[Suspended]")); else entry["Description"] = ci->desc; list.AddEntry(entry); diff --git a/modules/commands/cs_log.cpp b/modules/commands/cs_log.cpp index 643fa152e..cca0d19de 100644 --- a/modules/commands/cs_log.cpp +++ b/modules/commands/cs_log.cpp @@ -124,7 +124,7 @@ public: else { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Service").AddColumn("Command").AddColumn("Method").AddColumn(""); + list.AddColumn(_("Number")).AddColumn(_("Service")).AddColumn(_("Command")).AddColumn(_("Method")).AddColumn(""); for (unsigned i = 0; i < (*ls)->size(); ++i) { diff --git a/modules/commands/cs_mode.cpp b/modules/commands/cs_mode.cpp index c40678a5f..1d3050f32 100644 --- a/modules/commands/cs_mode.cpp +++ b/modules/commands/cs_mode.cpp @@ -423,7 +423,7 @@ class CommandCSMode : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn("Mode").AddColumn("Param").AddColumn("Creator").AddColumn("Created"); + list.AddColumn(_("Mode")).AddColumn(_("Param")).AddColumn(_("Creator")).AddColumn(_("Created")); for (ModeLocks::ModeList::const_iterator it = mlocks.begin(), it_end = mlocks.end(); it != it_end; ++it) { @@ -701,8 +701,8 @@ class CommandCSMode : public Command "on a channel.\n" " \n" "The \002%s LOCK\002 command allows you to add, delete, and view mode locks on a channel.\n" - "If a mode is locked on or off, services will not allow that mode to be changed. The \2SET\2\n" - "command will clear all existing mode locks and set the new one given, while \2ADD\2 and \2DEL\2\n" + "If a mode is locked on or off, services will not allow that mode to be changed. The \002SET\002\n" + "command will clear all existing mode locks and set the new one given, while \002ADD\002 and \002DEL\002\n" "modify the existing mode lock.\n" "Example:\n" " \002MODE #channel LOCK ADD +bmnt *!*@*aol*\002\n" @@ -812,9 +812,9 @@ class CommandCSModes : public Command if (!m.second.empty()) { if (m.first) - return Anope::printf(_("Gives you or the specified nick %s status on a channel"), m.second.c_str()); + return Anope::printf(Language::Translate(source.GetAccount(), _("Gives you or the specified nick %s status on a channel")), m.second.c_str()); else - return Anope::printf(_("Removes %s status from you or the specified nick on a channel"), m.second.c_str()); + return Anope::printf(Language::Translate(source.GetAccount(), _("Removes %s status from you or the specified nick on a channel")), m.second.c_str()); } else return ""; diff --git a/modules/commands/cs_set.cpp b/modules/commands/cs_set.cpp index 2998a850a..228a593be 100644 --- a/modules/commands/cs_set.cpp +++ b/modules/commands/cs_set.cpp @@ -1303,13 +1303,13 @@ class CSSet : public Module if (peace.HasExt(ci)) info.AddOption(_("Peace")); if (restricted.HasExt(ci)) - info.AddOption(_("Restricted Access")); + info.AddOption(_("Restricted access")); if (secure.HasExt(ci)) info.AddOption(_("Security")); if (securefounder.HasExt(ci)) - info.AddOption(_("Secure Founder")); + info.AddOption(_("Secure founder")); if (secureops.HasExt(ci)) - info.AddOption(_("Secure Ops")); + info.AddOption(_("Secure ops")); if (signkick.HasExt(ci) || signkick_level.HasExt(ci)) info.AddOption(_("Signed kicks")); if (persist.HasExt(ci)) @@ -1318,10 +1318,12 @@ class CSSet : public Module info.AddOption(_("No expire")); if (keep_modes.HasExt(ci)) info.AddOption(_("Keep modes")); + if (noautoop.HasExt(ci)) + info.AddOption(_("No auto-op")); time_t chanserv_expire = Config->GetModule(this)->Get<time_t>("expire", "14d"); if (!noexpire.HasExt(ci) && chanserv_expire && !Anope::NoExpire) - info["Expires on"] = Anope::strftime(ci->last_used + chanserv_expire); + info[_("Expires")] = Anope::strftime(ci->last_used + chanserv_expire, source.GetAccount()); } }; diff --git a/modules/commands/cs_suspend.cpp b/modules/commands/cs_suspend.cpp index bc122d048..ca2fd0893 100644 --- a/modules/commands/cs_suspend.cpp +++ b/modules/commands/cs_suspend.cpp @@ -94,7 +94,7 @@ class CommandCSSuspend : public Command if (ci->HasExt("CS_SUSPENDED")) { - source.Reply(_("\2%s\2 is already suspended."), ci->name.c_str()); + source.Reply(_("\002%s\002 is already suspended."), ci->name.c_str()); return; } @@ -213,15 +213,15 @@ class CSSuspend : public Module CSSuspendInfo *si = suspend.Get(ci); if (si) { - info["Suspended"] = "This channel is \2suspended\2."; + info[_("Suspended")] = _("This channel is \002suspended\002."); if (!si->by.empty()) - info["Suspended by"] = si->by; + info[_("Suspended by")] = si->by; if (!si->reason.empty()) - info["Suspend reason"] = si->reason; + info[_("Suspend reason")] = si->reason; if (si->time) - info["Suspended on"] = Anope::strftime(si->time, source.GetAccount(), true); + info[_("Suspended on")] = Anope::strftime(si->time, source.GetAccount(), true); if (si->expires) - info["Suspended expires"] = Anope::strftime(si->expires, source.GetAccount(), true); + info[_("Suspension expires")] = Anope::strftime(si->expires, source.GetAccount(), true); } } diff --git a/modules/commands/cs_topic.cpp b/modules/commands/cs_topic.cpp index 95c83f154..cb015e94a 100644 --- a/modules/commands/cs_topic.cpp +++ b/modules/commands/cs_topic.cpp @@ -248,16 +248,16 @@ class CSTopic : public Module void OnChanInfo(CommandSource &source, ChannelInfo *ci, InfoFormatter &info, bool show_all) anope_override { if (keeptopic.HasExt(ci)) - info.AddOption(_("Topic Retention")); + info.AddOption(_("Topic retention")); if (topiclock.HasExt(ci)) - info.AddOption(_("Topic Lock")); + info.AddOption(_("Topic lock")); ModeLocks *ml = ci->GetExt<ModeLocks>("modelocks"); const ModeLock *secret = ml ? ml->GetMLock("SECRET") : NULL; if (!ci->last_topic.empty() && (show_all || ((!secret || secret->set == false) && (!ci->c || !ci->c->HasMode("SECRET"))))) { - info["Last topic"] = ci->last_topic; - info["Topic set by"] = ci->last_topic_setter; + info[_("Last topic")] = ci->last_topic; + info[_("Topic set by")] = ci->last_topic_setter; } } }; diff --git a/modules/commands/cs_xop.cpp b/modules/commands/cs_xop.cpp index 0b404ea6a..67ce6898d 100644 --- a/modules/commands/cs_xop.cpp +++ b/modules/commands/cs_xop.cpp @@ -379,7 +379,7 @@ class CommandCSXOP : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask"); + list.AddColumn(_("Number")).AddColumn(_("Mask")); if (!nick.empty() && nick.find_first_not_of("1234567890,-") == Anope::string::npos) { @@ -483,15 +483,15 @@ class CommandCSXOP : public Command public: CommandCSXOP(Module *modname) : Command(modname, "chanserv/xop", 2, 4) { - this->SetSyntax("\037channel\037 ADD \037mask\037"); - this->SetSyntax("\037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}"); - this->SetSyntax("\037channel\037 LIST [\037mask\037 | \037list\037]"); - this->SetSyntax("\037channel\037 CLEAR"); + this->SetSyntax(_("\037channel\037 ADD \037mask\037")); + this->SetSyntax(_("\037channel\037 DEL {\037mask\037 | \037entry-num\037 | \037list\037}")); + this->SetSyntax(_("\037channel\037 LIST [\037mask\037 | \037list\037]")); + this->SetSyntax(_("\037channel\037 CLEAR")); } const Anope::string GetDesc(CommandSource &source) const anope_override { - return Anope::printf(_("Modify the list of %s users"), source.command.upper().c_str()); + return Anope::printf(Language::Translate(source.GetAccount(), _("Modify the list of %s users")), source.command.upper().c_str()); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) @@ -524,7 +524,7 @@ class CommandCSXOP : public Command this->SendSyntax(source); source.Reply(" "); - source.Reply(_("Maintains the \2%s list\2 for a channel. Users who match an access entry\n" + source.Reply(_("Maintains the \002%s list\002 for a channel. Users who match an access entry\n" "on the %s list receive the following privileges:\n" " "), cmd.c_str(), cmd.c_str()); diff --git a/modules/commands/hs_list.cpp b/modules/commands/hs_list.cpp index e0b2b8834..5e7b4beb8 100644 --- a/modules/commands/hs_list.cpp +++ b/modules/commands/hs_list.cpp @@ -55,7 +55,7 @@ class CommandHSList : public Command unsigned display_counter = 0, listmax = Config->GetModule(this->owner)->Get<unsigned>("listmax", "50"); ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Nick").AddColumn("Vhost").AddColumn("Creator").AddColumn("Created"); + list.AddColumn(_("Number")).AddColumn(_("Nick")).AddColumn(_("Vhost")).AddColumn(_("Creator")).AddColumn(_("Created")); for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it) { @@ -78,7 +78,7 @@ class CommandHSList : public Command else entry["Vhost"] = na->GetVhostHost(); entry["Creator"] = na->GetVhostCreator(); - entry["Created"] = Anope::strftime(na->GetVhostCreated()); + entry["Created"] = Anope::strftime(na->GetVhostCreated(), source.GetAccount()); list.AddEntry(entry); } } @@ -99,7 +99,7 @@ class CommandHSList : public Command else entry["Vhost"] = na->GetVhostHost(); entry["Creator"] = na->GetVhostCreator(); - entry["Created"] = Anope::strftime(na->GetVhostCreated()); + entry["Created"] = Anope::strftime(na->GetVhostCreated(), source.GetAccount()); list.AddEntry(entry); } } diff --git a/modules/commands/hs_request.cpp b/modules/commands/hs_request.cpp index 36e12505d..3b3865c41 100644 --- a/modules/commands/hs_request.cpp +++ b/modules/commands/hs_request.cpp @@ -297,7 +297,7 @@ class CommandHSWaiting : public Command unsigned display_counter = 0, listmax = Config->GetModule(this->owner)->Get<unsigned>("listmax"); ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Nick").AddColumn("Vhost").AddColumn("Created"); + list.AddColumn(_("Number")).AddColumn(_("Nick")).AddColumn(_("Vhost")).AddColumn(_("Created")); for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it) { @@ -317,7 +317,7 @@ class CommandHSWaiting : public Command entry["Vhost"] = hr->ident + "@" + hr->host; else entry["Vhost"] = hr->host; - entry["Created"] = Anope::strftime(hr->time); + entry["Created"] = Anope::strftime(hr->time, source.GetAccount()); list.AddEntry(entry); } ++counter; @@ -329,7 +329,7 @@ class CommandHSWaiting : public Command for (unsigned i = 0; i < replies.size(); ++i) source.Reply(replies[i]); - source.Reply(_("Displayed \2%d\2 records (\2%d\2 total)."), display_counter, counter); + source.Reply(_("Displayed \002%d\002 records (\002%d\002 total)."), display_counter, counter); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override diff --git a/modules/commands/ms_check.cpp b/modules/commands/ms_check.cpp index 452a0f337..a6d72c376 100644 --- a/modules/commands/ms_check.cpp +++ b/modules/commands/ms_check.cpp @@ -46,9 +46,9 @@ class CommandMSCheck : public Command found = true; /* Yes, we've found the memo */ if (mi->GetMemo(i)->unread) - source.Reply(_("The last memo you sent to %s (sent on %s) has not yet been read."), na->nick.c_str(), Anope::strftime(mi->GetMemo(i)->time).c_str()); + source.Reply(_("The last memo you sent to %s (sent on %s) has not yet been read."), na->nick.c_str(), Anope::strftime(mi->GetMemo(i)->time, source.GetAccount()).c_str()); else - source.Reply(_("The last memo you sent to %s (sent on %s) has been read."), na->nick.c_str(), Anope::strftime(mi->GetMemo(i)->time).c_str()); + source.Reply(_("The last memo you sent to %s (sent on %s) has been read."), na->nick.c_str(), Anope::strftime(mi->GetMemo(i)->time, source.GetAccount()).c_str()); break; } } diff --git a/modules/commands/ms_ignore.cpp b/modules/commands/ms_ignore.cpp index fd4f56e4a..a46f1a0a3 100644 --- a/modules/commands/ms_ignore.cpp +++ b/modules/commands/ms_ignore.cpp @@ -77,7 +77,7 @@ class CommandMSIgnore : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn("Mask"); + list.AddColumn(_("Mask")); for (unsigned i = 0; i < mi->ignores.size(); ++i) { ListFormatter::ListEntry entry; diff --git a/modules/commands/ms_list.cpp b/modules/commands/ms_list.cpp index 16db11ddb..c0c04f3f7 100644 --- a/modules/commands/ms_list.cpp +++ b/modules/commands/ms_list.cpp @@ -61,7 +61,7 @@ class CommandMSList : public Command { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Sender").AddColumn("Date/Time"); + list.AddColumn(_("Number")).AddColumn(_("Sender")).AddColumn(_("Date/Time")); if (!param.empty() && isdigit(param[0])) { @@ -85,7 +85,7 @@ class CommandMSList : public Command ListFormatter::ListEntry entry; entry["Number"] = (m->unread ? "* " : " ") + stringify(number + 1); entry["Sender"] = m->sender; - entry["Date/Time"] = Anope::strftime(m->time); + entry["Date/Time"] = Anope::strftime(m->time, source.GetAccount()); this->list.AddEntry(entry); } } @@ -120,7 +120,7 @@ class CommandMSList : public Command ListFormatter::ListEntry entry; entry["Number"] = (m->unread ? "* " : " ") + stringify(i + 1); entry["Sender"] = m->sender; - entry["Date/Time"] = Anope::strftime(m->time); + entry["Date/Time"] = Anope::strftime(m->time, source.GetAccount()); list.AddEntry(entry); } } diff --git a/modules/commands/ms_read.cpp b/modules/commands/ms_read.cpp index b32f474ea..3c3114474 100644 --- a/modules/commands/ms_read.cpp +++ b/modules/commands/ms_read.cpp @@ -72,9 +72,9 @@ class MemoListCallback : public NumberList return; if (ci) - source.Reply(_("Memo %d from %s (%s)."), index + 1, m->sender.c_str(), Anope::strftime(m->time).c_str()); + source.Reply(_("Memo %d from %s (%s)."), index + 1, m->sender.c_str(), Anope::strftime(m->time, source.GetAccount()).c_str()); else - source.Reply(_("Memo %d from %s (%s)."), index + 1, m->sender.c_str(), Anope::strftime(m->time).c_str()); + source.Reply(_("Memo %d from %s (%s)."), index + 1, m->sender.c_str(), Anope::strftime(m->time, source.GetAccount()).c_str()); BotInfo *bi; Anope::string cmd; diff --git a/modules/commands/ns_ajoin.cpp b/modules/commands/ns_ajoin.cpp index 73374c714..9a0ab0538 100644 --- a/modules/commands/ns_ajoin.cpp +++ b/modules/commands/ns_ajoin.cpp @@ -97,7 +97,7 @@ class CommandNSAJoin : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Channel").AddColumn("Key"); + list.AddColumn(_("Number")).AddColumn(_("Channel")).AddColumn(_("Key")); for (unsigned i = 0; i < (*channels)->size(); ++i) { AJoinEntry *aj = (*channels)->at(i); diff --git a/modules/commands/ns_alist.cpp b/modules/commands/ns_alist.cpp index 5035bfa1a..c80a479fc 100644 --- a/modules/commands/ns_alist.cpp +++ b/modules/commands/ns_alist.cpp @@ -45,7 +45,7 @@ class CommandNSAList : public Command ListFormatter list(source.GetAccount()); int chan_count = 0; - list.AddColumn("Number").AddColumn("Channel").AddColumn("Access"); + list.AddColumn(_("Number")).AddColumn(_("Channel")).AddColumn(_("Access")); source.Reply(_("Channels that \002%s\002 has access on:"), nc->display.c_str()); @@ -55,7 +55,7 @@ class CommandNSAList : public Command if (queue.empty()) { - source.Reply(_("\2%s\2 has no access in any channels."), nc->display.c_str()); + source.Reply(_("\002%s\002 has no access in any channels."), nc->display.c_str()); return; } @@ -69,7 +69,7 @@ class CommandNSAList : public Command ++chan_count; entry["Number"] = stringify(chan_count); entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name; - entry["Access"] = "Founder"; + entry["Access"] = Language::Translate(source.GetAccount(), _("Founder")); list.AddEntry(entry); continue; } @@ -79,7 +79,7 @@ class CommandNSAList : public Command ++chan_count; entry["Number"] = stringify(chan_count); entry["Channel"] = (ci->HasExt("CS_NO_EXPIRE") ? "!" : "") + ci->name; - entry["Access"] = "Successor"; + entry["Access"] = Language::Translate(source.GetAccount(), _("Successor")); list.AddEntry(entry); continue; } diff --git a/modules/commands/ns_cert.cpp b/modules/commands/ns_cert.cpp index 2c623ce5b..c8274f4d6 100644 --- a/modules/commands/ns_cert.cpp +++ b/modules/commands/ns_cert.cpp @@ -151,7 +151,7 @@ class CommandNSCert : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Certificate"); + list.AddColumn(_("Certificate")); for (unsigned i = 0; i < cl->GetCertCount(); ++i) { @@ -241,7 +241,7 @@ class CommandNSCert : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Certificate"); + list.AddColumn(_("Certificate")); for (unsigned i = 0; i < cl->GetCertCount(); ++i) { @@ -260,9 +260,9 @@ class CommandNSCert : public Command public: CommandNSCert(Module *creator) : Command(creator, "nickserv/cert", 1, 2) { - this->SetDesc("Modify the nickname client certificate list"); - this->SetSyntax("ADD \037fingerprint\037"); - this->SetSyntax("DEL \037fingerprint\037"); + this->SetDesc(_("Modify the nickname client certificate list")); + this->SetSyntax(_("ADD \037fingerprint\037")); + this->SetSyntax(_("DEL \037fingerprint\037")); this->SetSyntax("LIST"); } diff --git a/modules/commands/ns_group.cpp b/modules/commands/ns_group.cpp index 2f49eb7ac..ffb9a4dbc 100644 --- a/modules/commands/ns_group.cpp +++ b/modules/commands/ns_group.cpp @@ -296,7 +296,7 @@ class CommandNSGList : public Command nc = source.GetAccount(); ListFormatter list(source.GetAccount()); - list.AddColumn("Nick").AddColumn("Expires"); + list.AddColumn(_("Nick")).AddColumn(_("Expires")); time_t nickserv_expire = Config->GetModule("nickserv")->Get<time_t>("expire"); for (unsigned i = 0; i < nc->aliases->size(); ++i) { @@ -304,7 +304,7 @@ class CommandNSGList : public Command ListFormatter::ListEntry entry; entry["Nick"] = na2->nick; - entry["Expires"] = (na2->HasExt("NS_NO_EXPIRE") || !nickserv_expire || Anope::NoExpire) ? "Does not expire" : ("expires in " + Anope::strftime(na2->last_seen + nickserv_expire)); + entry["Expires"] = (na2->HasExt("NS_NO_EXPIRE") || !nickserv_expire || Anope::NoExpire) ? "Does not expire" : Anope::strftime(na2->last_seen + nickserv_expire, source.GetAccount()); list.AddEntry(entry); } @@ -315,7 +315,7 @@ class CommandNSGList : public Command for (unsigned i = 0; i < replies.size(); ++i) source.Reply(replies[i]); - source.Reply(_("%d nicknames in the group."), nc->aliases->size()); + source.Reply(_("%d nickname(s) in the group."), nc->aliases->size()); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override diff --git a/modules/commands/ns_info.cpp b/modules/commands/ns_info.cpp index b15357b26..c2b09981e 100644 --- a/modules/commands/ns_info.cpp +++ b/modules/commands/ns_info.cpp @@ -77,10 +77,10 @@ class CommandNSInfo : public Command info[_("Last seen address")] = na->last_realhost; } - info[_("Time registered")] = Anope::strftime(na->time_registered); + info[_("Registered")] = Anope::strftime(na->time_registered, source.GetAccount()); if (!nick_online) - info[_("Last seen")] = Anope::strftime(na->last_seen); + info[_("Last seen")] = Anope::strftime(na->last_seen, source.GetAccount()); if (!na->last_quit.empty() && (show_hidden || !na->nc->HasExt("HIDE_QUIT"))) info[_("Last quit message")] = na->last_quit; @@ -221,7 +221,7 @@ class CommandNSSASetHide : public CommandNSSetHide public: CommandNSSASetHide(Module *creator) : CommandNSSetHide(creator, "nickserv/saset/hide", 3) { - this->SetSyntax("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}"); + this->SetSyntax(_("\037nickname\037 {EMAIL | STATUS | USERMASK | QUIT} {ON | OFF}")); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override diff --git a/modules/commands/ns_list.cpp b/modules/commands/ns_list.cpp index 66ff914e9..fbc674eb6 100644 --- a/modules/commands/ns_list.cpp +++ b/modules/commands/ns_list.cpp @@ -72,7 +72,7 @@ class CommandNSList : public Command mync = source.nc; ListFormatter list(source.GetAccount()); - list.AddColumn("Nick").AddColumn("Last usermask"); + list.AddColumn(_("Nick")).AddColumn(_("Last usermask")); Anope::map<NickAlias *> ordered_map; for (nickalias_map::const_iterator it = NickAliasList->begin(), it_end = NickAliasList->end(); it != it_end; ++it) @@ -107,11 +107,11 @@ class CommandNSList : public Command ListFormatter::ListEntry entry; entry["Nick"] = (isnoexpire ? "!" : "") + na->nick; if (na->nc->HasExt("HIDE_MASK") && !is_servadmin && na->nc != mync) - entry["Last usermask"] = "[Hostname hidden]"; + entry["Last usermask"] = Language::Translate(source.GetAccount(), _("[Hostname hidden]")); else if (na->nc->HasExt("NS_SUSPENDED")) - entry["Last usermask"] = "[Suspended]"; + entry["Last usermask"] = Language::Translate(source.GetAccount(), _("[Suspended]")); else if (na->nc->HasExt("UNCONFIRMED")) - entry["Last usermask"] = "[Unconfirmed]"; + entry["Last usermask"] = Language::Translate(source.GetAccount(), _("[Unconfirmed]")); else entry["Last usermask"] = na->last_usermask; list.AddEntry(entry); diff --git a/modules/commands/ns_recover.cpp b/modules/commands/ns_recover.cpp index 4aed411ea..b6cbe2621 100644 --- a/modules/commands/ns_recover.cpp +++ b/modules/commands/ns_recover.cpp @@ -127,7 +127,7 @@ class CommandNSRecover : public Command CommandNSRecover(Module *creator) : Command(creator, "nickserv/recover", 1, 2) { this->SetDesc(_("Regains control of your nick")); - this->SetSyntax("\037nickname\037 [\037password\037]"); + this->SetSyntax(_("\037nickname\037 [\037password\037]")); this->AllowUnregistered(true); } diff --git a/modules/commands/ns_register.cpp b/modules/commands/ns_register.cpp index 446990aac..176b78553 100644 --- a/modules/commands/ns_register.cpp +++ b/modules/commands/ns_register.cpp @@ -228,7 +228,7 @@ class CommandNSRegister : public Command Anope::string cmd; if (Command::FindCommandFromService("nickserv/confirm", bi, cmd)) source.Reply(_("A passcode has been sent to %s, please type \002%s%s %s <passcode>\002 to confirm your email address."), email.c_str(), Config->StrictPrivmsg.c_str(), bi->nick.c_str(), cmd.c_str()); - source.Reply(_("If you do not confirm your email address within %s your account will expire."), Anope::Duration(unconfirmed_expire).c_str()); + source.Reply(_("If you do not confirm your email address within %s your account will expire."), Anope::Duration(unconfirmed_expire, source.GetAccount()).c_str()); } } @@ -368,7 +368,7 @@ class NSRegister : public Module time_t time_registered = Anope::CurTime - this_na->time_registered; time_t unconfirmed_expire = Config->GetModule(this)->Get<time_t>("unconfirmedexpire", "1d"); if (unconfirmed_expire > time_registered) - u->SendMessage(NickServ, _("Your account will expire, if not confirmed, in %s"), Anope::Duration(unconfirmed_expire - time_registered).c_str()); + u->SendMessage(NickServ, _("Your account will expire, if not confirmed, in %s"), Anope::Duration(unconfirmed_expire - time_registered, u->Account()).c_str()); } } diff --git a/modules/commands/ns_suspend.cpp b/modules/commands/ns_suspend.cpp index ac4fdfaed..6625a63ec 100644 --- a/modules/commands/ns_suspend.cpp +++ b/modules/commands/ns_suspend.cpp @@ -103,7 +103,7 @@ class CommandNSSuspend : public Command if (na->nc->HasExt("NS_SUSPENDED")) { - source.Reply(_("\2%s\2 is already suspended."), na->nc->display.c_str()); + source.Reply(_("\002%s\002 is already suspended."), na->nc->display.c_str()); return; } @@ -217,15 +217,15 @@ class NSSuspend : public Module NSSuspendInfo *s = suspend.Get(na->nc); if (s) { - info["Suspended"] = "This nickname is \2suspended\2."; + info[_("Suspended")] = _("This nickname is \002suspended\002."); if (!s->by.empty()) - info["Suspended by"] = s->by; + info[_("Suspended by")] = s->by; if (!s->reason.empty()) - info["Suspend reason"] = s->reason; + info[_("Suspend reason")] = s->reason; if (s->when) - info["Suspended on"] = Anope::strftime(s->when, source.GetAccount(), true); + info[_("Suspended on")] = Anope::strftime(s->when, source.GetAccount(), true); if (s->expires) - info["Suspended expires"] = Anope::strftime(s->expires, source.GetAccount(), true); + info[_("Suspension expires")] = Anope::strftime(s->expires, source.GetAccount(), true); } } diff --git a/modules/commands/os_akill.cpp b/modules/commands/os_akill.cpp index 87d59379f..e7b46714f 100644 --- a/modules/commands/os_akill.cpp +++ b/modules/commands/os_akill.cpp @@ -328,7 +328,7 @@ class CommandOSAKill : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Reason")); this->ProcessList(source, params, list); } @@ -342,7 +342,7 @@ class CommandOSAKill : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("Creator").AddColumn("Created").AddColumn("Expires").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Expires")).AddColumn(_("Reason")); this->ProcessList(source, params, list); } @@ -367,7 +367,7 @@ class CommandOSAKill : public Command this->SetSyntax(_("DEL {\037mask\037 | \037entry-num\037 | \037list\037 | \037id\037}")); this->SetSyntax(_("LIST [\037mask\037 | \037list\037 | \037id\037]")); this->SetSyntax(_("VIEW [\037mask\037 | \037list\037 | \037id\037]")); - this->SetSyntax(_("CLEAR")); + this->SetSyntax("CLEAR"); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override diff --git a/modules/commands/os_config.cpp b/modules/commands/os_config.cpp index f3f618f09..a7df06f27 100644 --- a/modules/commands/os_config.cpp +++ b/modules/commands/os_config.cpp @@ -54,7 +54,7 @@ class CommandOSConfig : public Command continue; ListFormatter lflist(source.GetAccount()); - lflist.AddColumn("Name").AddColumn("Value"); + lflist.AddColumn(_("Name")).AddColumn(_("Value")); for (Configuration::Block::item_map::const_iterator it = items->begin(), it_end = items->end(); it != it_end; ++it) { diff --git a/modules/commands/os_dns.cpp b/modules/commands/os_dns.cpp index 4d31aeb5a..7c13a1dbb 100644 --- a/modules/commands/os_dns.cpp +++ b/modules/commands/os_dns.cpp @@ -214,7 +214,7 @@ class CommandOSDNS : public Command } ListFormatter lf(source.GetAccount()); - lf.AddColumn("Server").AddColumn("IP").AddColumn("Limit").AddColumn("State"); + lf.AddColumn(_("Server")).AddColumn(_("IP")).AddColumn(_("Limit")).AddColumn(_("State")); for (unsigned i = 0; i < dns_servers->size(); ++i) { DNSServer *s = dns_servers->at(i); @@ -222,7 +222,7 @@ class CommandOSDNS : public Command ListFormatter::ListEntry entry; entry["Server"] = s->GetName(); - entry["Limit"] = s->GetLimit() ? stringify(s->GetLimit()) : "None"; + entry["Limit"] = s->GetLimit() ? stringify(s->GetLimit()) : Language::Translate(source.GetAccount(), _("None")); Anope::string ip_str; for (unsigned j = 0; j < s->GetIPs().size(); ++j) @@ -233,13 +233,13 @@ class CommandOSDNS : public Command entry["IP"] = ip_str; if (!srv) - entry["State"] = "Split"; + entry["State"] = Language::Translate(source.GetAccount(), _("Split")); else if (s->Active()) - entry["State"] = "Pooled/Active"; + entry["State"] = Language::Translate(source.GetAccount(), _("Pooled/Active")); else if (s->Pooled()) - entry["State"] = "Pooled/Not Active"; + entry["State"] = Language::Translate(source.GetAccount(), _("Pooled/Not Active")); else - entry["State"] = "Unpooled"; + entry["State"] = Language::Translate(source.GetAccount(), _("Unpooled")); lf.AddEntry(entry); } @@ -250,7 +250,7 @@ class CommandOSDNS : public Command if (!zones->empty()) { ListFormatter lf2(source.GetAccount()); - lf2.AddColumn("Zone").AddColumn("Servers"); + lf2.AddColumn(_("Zone")).AddColumn(_("Servers")); for (unsigned i = 0; i < zones->size(); ++i) { diff --git a/modules/commands/os_forbid.cpp b/modules/commands/os_forbid.cpp index 6854a4e27..028ab9107 100644 --- a/modules/commands/os_forbid.cpp +++ b/modules/commands/os_forbid.cpp @@ -94,7 +94,7 @@ class CommandOSForbid : public Command this->SetDesc(_("Forbid usage of nicknames, channels, and emails")); this->SetSyntax(_("ADD {NICK|CHAN|EMAIL|REGISTER} [+\037expiry\037] \037entry\037\002 \037reason\037")); this->SetSyntax(_("DEL {NICK|CHAN|EMAIL|REGISTER} \037entry\037")); - this->SetSyntax(_("LIST (NICK|CHAN|EMAIL|REGISTER)")); + this->SetSyntax("LIST (NICK|CHAN|EMAIL|REGISTER)"); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override @@ -171,7 +171,7 @@ class CommandOSForbid : public Command this->fs->AddForbid(d); Log(LOG_ADMIN, source, this) << "to add a forbid on " << entry << " of type " << subcommand; - source.Reply(_("Added a forbid on %s to expire on %s."), entry.c_str(), d->expires ? Anope::strftime(d->expires).c_str() : "never"); + source.Reply(_("Added a forbid on %s to expire on %s."), entry.c_str(), d->expires ? Anope::strftime(d->expires, source.GetAccount()).c_str() : "never"); /* apply forbid */ switch (ftype) @@ -197,7 +197,7 @@ class CommandOSForbid : public Command delete na; } - source.Reply(_("\2%d\2 nicknames dropped."), na_matches); + source.Reply(_("\002%d\002 nicknames dropped."), na_matches); break; } case FT_CHAN: @@ -259,7 +259,7 @@ class CommandOSForbid : public Command delete ci; } - source.Reply(_("\2%d\2 channels cleared, and \2%d\2 channels dropped."), chan_matches, ci_matches); + source.Reply(_("\002%d\002 channels cleared, and \002%d\002 channels dropped."), chan_matches, ci_matches); break; } @@ -290,7 +290,7 @@ class CommandOSForbid : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn("Mask").AddColumn("Type").AddColumn("Reason"); + list.AddColumn(_("Mask")).AddColumn(_("Type")).AddColumn(_("Reason")); for (unsigned i = 0; i < forbids.size(); ++i) { @@ -312,7 +312,7 @@ class CommandOSForbid : public Command entry["Mask"] = d->mask; entry["Type"] = stype; entry["Creator"] = d->creator; - entry["Expires"] = d->expires ? Anope::strftime(d->expires).c_str() : "never"; + entry["Expires"] = d->expires ? Anope::strftime(d->expires, source.GetAccount()).c_str() : "never"; entry["Reason"] = d->reason; list.AddEntry(entry); } diff --git a/modules/commands/os_ignore.cpp b/modules/commands/os_ignore.cpp index d3c60679d..4b549d2ed 100644 --- a/modules/commands/os_ignore.cpp +++ b/modules/commands/os_ignore.cpp @@ -177,7 +177,7 @@ class CommandOSIgnore : public Command else { source.Reply(_("\002%s\002 will now be ignored for \002%s\002."), nick.c_str(), Anope::Duration(t, source.GetAccount()).c_str()); - Log(LOG_ADMIN, source, this) << "to add an ignore on " << nick << " for " << Anope::Duration(t, source.GetAccount()); + Log(LOG_ADMIN, source, this) << "to add an ignore on " << nick << " for " << Anope::Duration(t); } } @@ -209,7 +209,7 @@ class CommandOSIgnore : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn("Mask").AddColumn("Creator").AddColumn("Reason").AddColumn("Expires"); + list.AddColumn(_("Mask")).AddColumn(_("Creator")).AddColumn(_("Reason")).AddColumn(_("Expires")); for (std::list<IgnoreData>::const_iterator ign = ignores.begin(), ign_end = ignores.end(); ign != ign_end; ++ign) { const IgnoreData &ignore = *ign; @@ -218,7 +218,7 @@ class CommandOSIgnore : public Command entry["Mask"] = ignore.mask; entry["Creator"] = ignore.creator; entry["Reason"] = ignore.reason; - entry["Expires"] = Anope::strftime(ignore.time); + entry["Expires"] = Anope::strftime(ignore.time, source.GetAccount()); list.AddEntry(entry); } @@ -268,8 +268,8 @@ class CommandOSIgnore : public Command this->SetDesc(_("Modify the Services ignore list")); this->SetSyntax(_("ADD \037time\037 {\037nick\037|\037mask\037} [\037reason\037]")); this->SetSyntax(_("DEL {\037nick\037|\037mask\037}")); - this->SetSyntax(_("LIST")); - this->SetSyntax(_("CLEAR")); + this->SetSyntax("LIST"); + this->SetSyntax("CLEAR"); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override diff --git a/modules/commands/os_info.cpp b/modules/commands/os_info.cpp index 553798d07..a47999d5e 100644 --- a/modules/commands/os_info.cpp +++ b/modules/commands/os_info.cpp @@ -144,7 +144,7 @@ class CommandOSInfo : public Command if ((*oi)->size() >= Config->GetModule(this->module)->Get<unsigned>("max", "10")) { - source.Reply(_("The oper info list for \2%s\2 is full."), target.c_str()); + source.Reply(_("The oper info list for \002%s\002 is full."), target.c_str()); return; } @@ -154,14 +154,14 @@ class CommandOSInfo : public Command if (o->info.equals_ci(info)) { - source.Reply(_("The oper info already exists on \2%s\2."), target.c_str()); + source.Reply(_("The oper info already exists on \002%s\002."), target.c_str()); return; } } (*oi)->push_back(new OperInfo(target, info, source.GetNick(), Anope::CurTime)); - source.Reply(_("Added info to \2%s\2."), target.c_str()); + source.Reply(_("Added info to \002%s\002."), target.c_str()); Log(LOG_ADMIN, source, this) << "to add information to " << target; } else if (cmd.equals_ci("DEL")) @@ -176,7 +176,7 @@ class CommandOSInfo : public Command if (!oi) { - source.Reply(_("Oper info list for \2%s\2 is empty."), target.c_str()); + source.Reply(_("Oper info list for \002%s\002 is empty."), target.c_str()); return; } @@ -195,14 +195,14 @@ class CommandOSInfo : public Command if (!found) { - source.Reply(_("No such info \"%s\" on \2%s\2."), info.c_str(), target.c_str()); + source.Reply(_("No such info \"%s\" on \002%s\002."), info.c_str(), target.c_str()); } else { if ((*oi)->empty()) e->Shrink<OperInfos>("operinfo"); - source.Reply(_("Deleted info from \2%s\2."), target.c_str()); + source.Reply(_("Deleted info from \002%s\002."), target.c_str()); Log(LOG_ADMIN, source, this) << "to remove information from " << target; } } @@ -212,13 +212,13 @@ class CommandOSInfo : public Command if (!oi) { - source.Reply(_("Oper info list for \2%s\2 is empty."), target.c_str()); + source.Reply(_("Oper info list for \002%s\002 is empty."), target.c_str()); return; } e->Shrink<OperInfos>("operinfo"); - source.Reply(_("Cleared info from \2%s\2"), target.c_str()); + source.Reply(_("Cleared info from \002%s\002."), target.c_str()); Log(LOG_ADMIN, source, this) << "to clear information for " << target; } else diff --git a/modules/commands/os_list.cpp b/modules/commands/os_list.cpp index d73d08eed..189413eac 100644 --- a/modules/commands/os_list.cpp +++ b/modules/commands/os_list.cpp @@ -39,7 +39,7 @@ class CommandOSChanList : public Command } ListFormatter list(source.GetAccount()); - list.AddColumn("Name").AddColumn("Users").AddColumn("Modes").AddColumn("Topic"); + list.AddColumn(_("Name")).AddColumn(_("Users")).AddColumn(_("Modes")).AddColumn(_("Topic")); if (!pattern.empty() && (u2 = User::Find(pattern, true))) { @@ -144,7 +144,7 @@ class CommandOSUserList : public Command modes.insert("INVIS"); ListFormatter list(source.GetAccount()); - list.AddColumn("Name").AddColumn("Mask"); + list.AddColumn(_("Name")).AddColumn(_("Mask")); if (!pattern.empty() && (c = Channel::Find(pattern))) { diff --git a/modules/commands/os_login.cpp b/modules/commands/os_login.cpp index 6c1edecfb..c48909298 100644 --- a/modules/commands/os_login.cpp +++ b/modules/commands/os_login.cpp @@ -58,7 +58,7 @@ class CommandOSLogin : public Command const Anope::string GetDesc(CommandSource &source) const anope_override { - return Anope::printf(_("Login to %s"), source.service->nick.c_str()); + return Anope::printf(Language::Translate(source.GetAccount(), _("Login to %s")), source.service->nick.c_str()); } }; @@ -100,7 +100,7 @@ class CommandOSLogout : public Command const Anope::string GetDesc(CommandSource &source) const anope_override { - return Anope::printf(_("Logout from %s"), source.service->nick.c_str()); + return Anope::printf(Language::Translate(source.GetAccount(), _("Logout from %s")), source.service->nick.c_str()); } }; diff --git a/modules/commands/os_modinfo.cpp b/modules/commands/os_modinfo.cpp index 8f172132e..a1bf1d2be 100644 --- a/modules/commands/os_modinfo.cpp +++ b/modules/commands/os_modinfo.cpp @@ -29,7 +29,7 @@ class CommandOSModInfo : public Command Module *m = ModuleManager::FindModule(file); if (m) { - source.Reply(_("Module: \002%s\002 Version: \002%s\002 Author: \002%s\002 Loaded: \002%s\002"), m->name.c_str(), !m->version.empty() ? m->version.c_str() : "?", !m->author.empty() ? m->author.c_str() : "Unknown", Anope::strftime(m->created).c_str()); + source.Reply(_("Module: \002%s\002 Version: \002%s\002 Author: \002%s\002 Loaded: \002%s\002"), m->name.c_str(), !m->version.empty() ? m->version.c_str() : "?", !m->author.empty() ? m->author.c_str() : "Unknown", Anope::strftime(m->created, source.GetAccount()).c_str()); if (Anope::Debug) source.Reply(_(" Loaded at: %p"), m->handle); diff --git a/modules/commands/os_news.cpp b/modules/commands/os_news.cpp index 61f48ff59..e12777d02 100644 --- a/modules/commands/os_news.cpp +++ b/modules/commands/os_news.cpp @@ -114,14 +114,14 @@ class NewsBase : public Command else { ListFormatter lflist(source.GetAccount()); - lflist.AddColumn("Number").AddColumn("Creator").AddColumn("Created").AddColumn("Text"); + lflist.AddColumn(_("Number")).AddColumn(_("Creator")).AddColumn(_("Created")).AddColumn(_("Text")); for (unsigned i = 0, end = list.size(); i < end; ++i) { ListFormatter::ListEntry entry; entry["Number"] = stringify(i + 1); entry["Creator"] = list[i]->who; - entry["Created"] = Anope::strftime(list[i]->time); + entry["Created"] = Anope::strftime(list[i]->time, source.GetAccount()); entry["Text"] = list[i]->text; lflist.AddEntry(entry); } @@ -235,7 +235,7 @@ class NewsBase : public Command { this->SetSyntax(_("ADD \037text\037")); this->SetSyntax(_("DEL {\037num\037 | ALL}")); - this->SetSyntax(_("LIST")); + this->SetSyntax("LIST"); } virtual ~NewsBase() diff --git a/modules/commands/os_oper.cpp b/modules/commands/os_oper.cpp index a83ba0d24..bb8c70728 100644 --- a/modules/commands/os_oper.cpp +++ b/modules/commands/os_oper.cpp @@ -70,7 +70,7 @@ class CommandOSOper : public Command this->SetSyntax(_("ADD \037oper\037 \037type\037")); this->SetSyntax(_("DEL \037oper\037")); this->SetSyntax(_("INFO \037type\037")); - this->SetSyntax(_("LIST")); + this->SetSyntax("LIST"); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override diff --git a/modules/commands/os_session.cpp b/modules/commands/os_session.cpp index a9c285601..551f17f7f 100644 --- a/modules/commands/os_session.cpp +++ b/modules/commands/os_session.cpp @@ -182,7 +182,7 @@ class CommandOSSession : public Command else { ListFormatter list(source.GetAccount()); - list.AddColumn("Session").AddColumn("Host"); + list.AddColumn(_("Session")).AddColumn(_("Host")); for (SessionService::SessionMap::iterator it = session_service->GetSessions().begin(), it_end = session_service->GetSessions().end(); it != it_end; ++it) { @@ -228,9 +228,9 @@ class CommandOSSession : public Command } if (!session) - source.Reply(_("\002%s\002 not found on session list, but has a limit of \002%d\002 because it matches entry: \2%s\2."), param.c_str(), limit, entry.c_str()); + source.Reply(_("\002%s\002 not found on session list, but has a limit of \002%d\002 because it matches entry: \002%s\002."), param.c_str(), limit, entry.c_str()); else - source.Reply(_("The host \002%s\002 currently has \002%d\002 sessions with a limit of \002%d\002 because it matches entry: \2%s\2."), session->addr.mask().c_str(), session->count, limit, entry.c_str()); + source.Reply(_("The host \002%s\002 currently has \002%d\002 sessions with a limit of \002%d\002 because it matches entry: \002%s\002."), session->addr.mask().c_str(), session->count, limit, entry.c_str()); } public: CommandOSSession(Module *creator) : Command(creator, "operserv/session", 2, 2) @@ -466,9 +466,10 @@ class CommandOSException : public Command { class ExceptionListCallback : public NumberList { + CommandSource &source; ListFormatter &list; public: - ExceptionListCallback(ListFormatter &_list, const Anope::string &numlist) : NumberList(numlist, false), list(_list) + ExceptionListCallback(CommandSource &_source, ListFormatter &_list, const Anope::string &numlist) : NumberList(numlist, false), source(_source), list(_list) { } @@ -483,13 +484,13 @@ class CommandOSException : public Command entry["Number"] = stringify(Number); entry["Mask"] = e->mask; entry["By"] = e->who; - entry["Created"] = Anope::strftime(e->time); + entry["Created"] = Anope::strftime(e->time, source.GetAccount()); entry["Limit"] = stringify(e->limit); entry["Reason"] = e->reason; this->list.AddEntry(entry); } } - nl_list(list, mask); + nl_list(source, list, mask); nl_list.Process(); } else @@ -503,7 +504,7 @@ class CommandOSException : public Command entry["Number"] = stringify(i + 1); entry["Mask"] = e->mask; entry["By"] = e->who; - entry["Created"] = Anope::strftime(e->time); + entry["Created"] = Anope::strftime(e->time, source.GetAccount()); entry["Limit"] = stringify(e->limit); entry["Reason"] = e->reason; list.AddEntry(entry); @@ -528,7 +529,7 @@ class CommandOSException : public Command void DoList(CommandSource &source, const std::vector<Anope::string> ¶ms) { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Limit").AddColumn("Mask"); + list.AddColumn(_("Number")).AddColumn(_("Limit")).AddColumn(_("Mask")); this->ProcessList(source, params, list); } @@ -536,7 +537,7 @@ class CommandOSException : public Command void DoView(CommandSource &source, const std::vector<Anope::string> ¶ms) { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("By").AddColumn("Created").AddColumn("Limit").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("By")).AddColumn(_("Created")).AddColumn(_("Limit")).AddColumn(_("Reason")); this->ProcessList(source, params, list); } @@ -546,7 +547,7 @@ class CommandOSException : public Command { this->SetDesc(_("Modify the session-limit exception list")); this->SetSyntax(_("ADD [\037+expiry\037] \037mask\037 \037limit\037 \037reason\037")); - this->SetSyntax(_("DEL {\037mask\037 | \037list\037}")); + this->SetSyntax(_("DEL {\037mask\037 | \037entry-num\037 | \037list\037}")); this->SetSyntax(_("MOVE \037num\037 \037position\037")); this->SetSyntax(_("LIST [\037mask\037 | \037list\037]")); this->SetSyntax(_("VIEW [\037mask\037 | \037list\037]")); diff --git a/modules/commands/os_stats.cpp b/modules/commands/os_stats.cpp index e2a3e5603..50d19692e 100644 --- a/modules/commands/os_stats.cpp +++ b/modules/commands/os_stats.cpp @@ -129,8 +129,8 @@ class CommandOSStats : public Command { time_t uptime = Anope::CurTime - Anope::StartTime; source.Reply(_("Current users: \002%d\002 (\002%d\002 ops)"), UserListByNick.size(), OperCount); - source.Reply(_("Maximum users: \002%d\002 (%s)"), MaxUserCount, Anope::strftime(MaxUserTime).c_str()); - source.Reply(_("Services up %s."), Anope::Duration(uptime).c_str()); + source.Reply(_("Maximum users: \002%d\002 (%s)"), MaxUserCount, Anope::strftime(MaxUserTime, source.GetAccount()).c_str()); + source.Reply(_("Services up %s."), Anope::Duration(uptime, source.GetAccount()).c_str()); return; } diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index b7e3cfcc3..82f0b2435 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -184,7 +184,7 @@ class CommandOSSXLineBase : public Command void OnList(CommandSource &source, const std::vector<Anope::string> ¶ms) { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("Reason")); this->ProcessList(source, params, list); } @@ -192,7 +192,7 @@ class CommandOSSXLineBase : public Command void OnView(CommandSource &source, const std::vector<Anope::string> ¶ms) { ListFormatter list(source.GetAccount()); - list.AddColumn("Number").AddColumn("Mask").AddColumn("By").AddColumn("Created").AddColumn("Expires").AddColumn("Reason"); + list.AddColumn(_("Number")).AddColumn(_("Mask")).AddColumn(_("By")).AddColumn(_("Created")).AddColumn(_("Expires")).AddColumn(_("Reason")); this->ProcessList(source, params, list); } @@ -213,7 +213,11 @@ class CommandOSSXLineBase : public Command public: CommandOSSXLineBase(Module *creator, const Anope::string &cmd) : Command(creator, cmd, 1, 4) { - this->SetDesc(Anope::printf(_("Manipulate the %s list"), cmd.c_str())); + } + + const Anope::string GetDesc(CommandSource &source) const anope_override + { + return Anope::printf(Language::Translate(source.GetAccount(), _("Manipulate the %s list")), source.command.upper().c_str()); } void Execute(CommandSource &source, const std::vector<Anope::string> ¶ms) anope_override @@ -408,7 +412,7 @@ class CommandOSSNLine : public CommandOSSXLineBase this->SetSyntax(_("DEL {\037mask\037 | \037entry-num\037 | \037list\037 | \037id\037}")); this->SetSyntax(_("LIST [\037mask\037 | \037list\037 | \037id\037]")); this->SetSyntax(_("VIEW [\037mask\037 | \037list\037 | \037id\037]")); - this->SetSyntax(_("CLEAR")); + this->SetSyntax("CLEAR"); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override @@ -641,7 +645,7 @@ class CommandOSSQLine : public CommandOSSXLineBase this->SetSyntax(_("DEL {\037mask\037 | \037entry-num\037 | \037list\037 | \037id\037}")); this->SetSyntax(_("LIST [\037mask\037 | \037list\037 | \037id\037]")); this->SetSyntax(_("VIEW [\037mask\037 | \037list\037 | \037id\037]")); - this->SetSyntax(_("CLEAR")); + this->SetSyntax("CLEAR"); } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override diff --git a/modules/pseudoclients/nickserv.cpp b/modules/pseudoclients/nickserv.cpp index dd1350073..234333025 100644 --- a/modules/pseudoclients/nickserv.cpp +++ b/modules/pseudoclients/nickserv.cpp @@ -522,12 +522,12 @@ class NickServCore : public Module, public NickServService { time_t nickserv_expire = Config->GetModule(this)->Get<time_t>("expire"); if (!na->HasExt("NS_NO_EXPIRE") && nickserv_expire && !Anope::NoExpire && na->last_seen != Anope::CurTime) - info[_("Expires")] = Anope::strftime(na->last_seen + nickserv_expire); + info[_("Expires")] = Anope::strftime(na->last_seen + nickserv_expire, source.GetAccount()); } else { time_t unconfirmed_expire = Config->GetModule(this)->Get<time_t>("unconfirmedexpire", "1d"); - info[_("Expires")] = Anope::strftime(na->time_registered + unconfirmed_expire); + info[_("Expires")] = Anope::strftime(na->time_registered + unconfirmed_expire, source.GetAccount()); } } }; |