summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2013-09-22 11:25:11 -0400
committerAdam <Adam@anope.org>2013-09-27 19:11:02 -0400
commit80c02740d0a99df96fa40e3f3d5bad4ea2e0e2ae (patch)
treefac80bb223506909a6e90d237e85ae048e1494a0 /src
parentdf3c0b7b52066698a97b34edf5352cf344e991ac (diff)
Translate listformatter properly
Diffstat (limited to 'src')
-rw-r--r--src/misc.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/misc.cpp b/src/misc.cpp
index fe0c49158..8e202aca6 100644
--- a/src/misc.cpp
+++ b/src/misc.cpp
@@ -121,6 +121,10 @@ bool NumberList::InvalidRange(const Anope::string &)
return true;
}
+ListFormatter::ListFormatter(NickCore *acc) : nc(acc)
+{
+}
+
ListFormatter &ListFormatter::AddColumn(const Anope::string &name)
{
this->columns.push_back(name);
@@ -139,10 +143,14 @@ bool ListFormatter::IsEmpty() const
void ListFormatter::Process(std::vector<Anope::string> &buffer)
{
+ std::vector<Anope::string> tcolumns;
std::map<Anope::string, size_t> lenghts;
std::set<Anope::string> breaks;
for (unsigned i = 0; i < this->columns.size(); ++i)
- lenghts[this->columns[i]] = this->columns[i].length();
+ {
+ tcolumns.push_back(Language::Translate(this->nc, this->columns[i].c_str()));
+ lenghts[this->columns[i]] = tcolumns[i].length();
+ }
for (unsigned i = 0; i < this->entries.size(); ++i)
{
ListEntry &e = this->entries[i];
@@ -176,9 +184,9 @@ void ListFormatter::Process(std::vector<Anope::string> &buffer)
}
else if (!s.empty())
s += " ";
- s += this->columns[i];
- if (i + 1 != this->columns.size())
- for (unsigned j = this->columns[i].length(); j < lenghts[this->columns[i]]; ++j)
+ s += tcolumns[i];
+ if (i + 1 != this->columns.size())
+ for (unsigned j = tcolumns[i].length(); j < lenghts[this->columns[i]]; ++j)
s += " ";
}
buffer.push_back(s);