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

Add some helper methods to CommandSource for translation.

This commit is contained in:
Sadie Powell
2026-04-26 18:07:56 +01:00
parent 7eb710a009
commit e2dc77641a
21 changed files with 74 additions and 51 deletions
+4 -4
View File
@@ -58,7 +58,7 @@ public:
info[_("Real name")] = bi->realname;
info[_("Created")] = Anope::strftime(bi->created, source.GetAccount());
info[_("Options")] = bi->oper_only ? _("Private") : _("None");
info[_("Used on")] = Anope::Format(Language::Translate(source.nc, bi->GetChannelCount(), N_("%u channel", "%u channels")), bi->GetChannelCount());
info[_("Used on")] = Anope::Format(source.Translate(bi->GetChannelCount(), N_("%u channel", "%u channels")), bi->GetChannelCount());
FOREACH_MOD(OnBotInfo, (source, bi, ci, info));
info.SendTo(source);
@@ -83,8 +83,8 @@ public:
source.Reply(CHAN_INFO_HEADER, ci->name.c_str());
info[_("Bot nick")] = ci->bi ? ci->bi->nick : _("not assigned yet");
Anope::string enabled = Language::Translate(source.nc, _("Enabled"));
Anope::string disabled = Language::Translate(source.nc, _("Disabled"));
Anope::string enabled = source.Translate(_("Enabled"));
Anope::string disabled = source.Translate(_("Disabled"));
FOREACH_MOD(OnBotInfo, (source, bi, ci, info));
info.SendTo(source);
@@ -120,7 +120,7 @@ public:
Anope::string GetDesc(CommandSource &source) const override
{
return Anope::Format(Language::Translate(source.GetAccount(), _("Allows you to see %s information about a channel or a bot")), source.service->nick.c_str());
return Anope::Format(source.Translate(_("Allows you to see %s information about a channel or a bot")), source.service->nick.c_str());
}
};