summaryrefslogtreecommitdiff
path: root/src/misc.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-22 14:14:00 -0400
committerAdam <Adam@anope.org>2013-09-27 19:11:02 -0400
commit994471f5a7f258a197cce6dffba97f470ee8f831 (patch)
treec8a24ed3cb20f7899058980d847466f8f781810a /src/misc.cpp
parent80c02740d0a99df96fa40e3f3d5bad4ea2e0e2ae (diff)
Align info formatters with translated keys?
Diffstat (limited to 'src/misc.cpp')
-rw-r--r--src/misc.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index 8e202aca6..35eddd87f 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -228,7 +228,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())) + ": " + Language::Translate(this->nc, it->second.c_str());
+ s += it->first + ": " + Language::Translate(this->nc, it->second.c_str());
buffer.push_back(s);
}
@@ -236,25 +236,27 @@ void InfoFormatter::Process(std::vector<Anope::string> &buffer)
Anope::string& InfoFormatter::operator[](const Anope::string &key)
{
- if (key.length() > this->longest)
- this->longest = key.length();
- this->replies.push_back(std::make_pair(key, ""));
+ Anope::string tkey = Language::Translate(this->nc, key.c_str());
+ if (tkey.length() > this->longest)
+ this->longest = tkey.length();
+ this->replies.push_back(std::make_pair(tkey, ""));
return this->replies.back().second;
}
void InfoFormatter::AddOption(const Anope::string &opt)
{
+ Anope::string options = Language::Translate(this->nc, "Options");
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")
+ if (it->first == options)
{
optstr = &it->second;
break;
}
}
if (!optstr)
- optstr = &(*this)["Options"];
+ optstr = &(*this)[_("Options")];
if (!optstr->empty())
*optstr += ", ";