1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 19:56:39 +02:00

Add a plural form overload of CommandSource::Reply.

This commit is contained in:
Sadie Powell
2024-11-19 17:02:11 +00:00
parent 1fb8a624f9
commit 687bcaa83f
5 changed files with 31 additions and 11 deletions
+15
View File
@@ -118,6 +118,21 @@ void CommandSource::Reply(const char *message, ...)
va_end(args);
}
void CommandSource::Reply(int count, const char *single, const char *plural, ...)
{
va_list args;
char buf[4096]; // Messages can be really big.
const char *translated_message = Language::Translate(this->nc, count, single, plural);
va_start(args, plural);
vsnprintf(buf, sizeof(buf), translated_message, args);
this->Reply(Anope::string(buf));
va_end(args);
}
void CommandSource::Reply(const Anope::string &message)
{
const char *translated_message = Language::Translate(this->nc, message.c_str());