Add: Translatable list separator. (#13149)

Some languages should use a separator other than ", " to separate list items, so it is now a translatable string.
This commit is contained in:
Peter Nelson
2024-12-06 12:32:36 +00:00
committed by GitHub
parent ef76f0e758
commit cba329d9e2
7 changed files with 26 additions and 6 deletions

View File

@@ -739,6 +739,7 @@ public:
SetDParam(0, this->selected->filesize);
tr.top = DrawStringMultiLine(tr, STR_CONTENT_DETAIL_FILESIZE);
std::string_view list_separator = GetListSeparator();
if (!this->selected->dependencies.empty()) {
/* List dependencies */
std::string buf;
@@ -749,7 +750,7 @@ public:
const ContentInfo *ci = *iter;
if (ci->id != cid) continue;
if (!buf.empty()) buf += ", ";
if (!buf.empty()) buf += list_separator;
buf += (*iter)->name;
break;
}
@@ -762,7 +763,7 @@ public:
/* List all tags */
std::string buf;
for (auto &tag : this->selected->tags) {
if (!buf.empty()) buf += ", ";
if (!buf.empty()) buf += list_separator;
buf += tag;
}
SetDParamStr(0, buf);
@@ -778,7 +779,7 @@ public:
for (const ContentInfo *ci : tree) {
if (ci == this->selected || ci->state != ContentInfo::SELECTED) continue;
if (!buf.empty()) buf += ", ";
if (!buf.empty()) buf += list_separator;
buf += ci->name;
}
if (!buf.empty()) {