summaryrefslogtreecommitdiff
path: root/include/commands.h
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2014-06-23 07:12:41 -0400
committerAdam <Adam@anope.org>2014-06-23 07:12:41 -0400
commit148b26f687ce85dc01e852a2358b03d493757ada (patch)
treef81ea553d0384ec6063eff45cfaff5aa92aaa1c9 /include/commands.h
parent0dba0692f9f88275b7d89d511bf22124217bc4c6 (diff)
Mostly working language string rewrite with new format strings
Diffstat (limited to 'include/commands.h')
-rw-r--r--include/commands.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/commands.h b/include/commands.h
index 359995f8f..6f29aa135 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -14,6 +14,7 @@
#include "service.h"
#include "anope.h"
#include "channels.h"
+#include "language.h"
struct CommandGroup
{
@@ -29,6 +30,8 @@ struct CommandInfo
/* Service name of the command */
Anope::string name;
+ /* User visible name */
+ Anope::string cname;
/* Permission required to execute the command */
Anope::string permission;
/* Group this command is in */
@@ -77,7 +80,13 @@ class CoreExport CommandSource
ChanServ::AccessGroup AccessFor(ChanServ::Channel *ci);
bool IsFounder(ChanServ::Channel *ci);
- void Reply(const char *message, ...);
+ template<typename... Args>
+ void Reply(const char *message, Args&&... args)
+ {
+ const char *translated_message = Language::Translate(this->nc, message);
+ Reply(Anope::Format(translated_message, std::forward<Args>(args)...));
+ }
+
void Reply(const Anope::string &message);
bool HasCommand(const Anope::string &cmd);