1
0
mirror of https://github.com/anope/anope.git synced 2026-07-08 00:03: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
+3 -3
View File
@@ -26,10 +26,10 @@ static inline void reset_levels(ChannelInfo *ci)
static Anope::string LevelToString(CommandSource &source, int16_t level)
{
if (level == ACCESS_INVALID)
return Language::Translate(source.GetAccount(), _("(disabled)"));
return source.Translate(_("(disabled)"));
if (level == ACCESS_FOUNDER)
return Language::Translate(source.GetAccount(), _("(founder only)"));
return source.Translate(_("(founder only)"));
return Anope::ToString(level);
}
@@ -893,7 +893,7 @@ public:
ListFormatter::ListEntry entry;
entry["Name"] = p.name;
entry["Default"] = LevelToString(source, defaultLevels[p.name]);
entry["Description"] = Language::Translate(source.nc, p.desc.c_str());
entry["Description"] = source.Translate(p.desc.c_str());
list.AddEntry(entry);
}