summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index fd08ffb2a..c9e18dc66 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -220,7 +220,7 @@ void InfoFormatter::Process(std::vector<Anope::string> &buffer)
Anope::string s;
for (unsigned i = it->first.length(); i < this->longest; ++i)
s += " ";
- s += Anope::string(Language::Translate(this->nc, it->first.c_str())) + ": " + it->second;
+ s += Anope::string(Language::Translate(this->nc, it->first.c_str())) + ": " + Language::Translate(this->nc, it->second.c_str());
buffer.push_back(s);
}
@@ -234,6 +234,25 @@ Anope::string& InfoFormatter::operator[](const Anope::string &key)
return this->replies.back().second;
}
+void InfoFormatter::AddOption(const Anope::string &opt)
+{
+ Anope::string *optstr = NULL;
+ for (std::vector<std::pair<Anope::string, Anope::string> >::iterator it = this->replies.begin(), it_end = this->replies.end(); it != it_end; ++it)
+ {
+ if (it->first == "Options")
+ {
+ optstr = &it->second;
+ break;
+ }
+ }
+ if (!optstr)
+ optstr = &(*this)["Options"];
+
+ if (!optstr->empty())
+ *optstr += ", ";
+ *optstr += Language::Translate(nc, opt.c_str());
+}
+
bool Anope::IsFile(const Anope::string &filename)
{
struct stat fileinfo;