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
+3 -1
View File
@@ -268,6 +268,8 @@ uint64_t CargoSpec::WeightOfNUnitsInTrain(uint32_t n) const
*/
std::optional<std::string> BuildCargoAcceptanceString(const CargoArray &acceptance, StringID label)
{
std::string_view list_separator = GetListSeparator();
/* Cargo acceptance is displayed in a extra multiline */
std::stringstream line;
line << GetString(label);
@@ -277,7 +279,7 @@ std::optional<std::string> BuildCargoAcceptanceString(const CargoArray &acceptan
CargoID cid = cs->Index();
if (acceptance[cid] > 0) {
/* Add a comma between each item. */
if (found) line << ", ";
if (found) line << list_separator;
found = true;
/* If the accepted value is less than 8, show it in 1/8:ths */