simplify the construction of 'goldmsg' a little...
...and make the code more readable
This commit is contained in:
parent
96143a8e7d
commit
74dee3c76f
1 changed files with 6 additions and 7 deletions
|
@ -362,15 +362,14 @@ LEVEL_RESULT playsingle_controller::play_scenario(const std::vector<config*>& st
|
|||
}
|
||||
report << '\n' << font::BOLD_TEXT << _("Retained Gold: ") << player->gold;
|
||||
|
||||
// Inclusion of number tempts one to translate uncountable "gold" as something
|
||||
// else, preferably countable. Thus plural. It does not matter that this
|
||||
// string isn't pluralizable (?) in English, translations are likely to be.
|
||||
// Note that both strings are the same in english, but they are supposed to be
|
||||
// different in the resultant translation files, for the languages that require it.
|
||||
std::string goldmsg = _n("You will start the next scenario with $gold or its defined minimum starting gold, whichever is higher.","You will start the next scenario with $gold or its defined minimum starting gold, whichever is higher.",player->gold);
|
||||
utils::string_map symbols;
|
||||
symbols["gold"] = lexical_cast_default<std::string>(player->gold);
|
||||
goldmsg = utils::interpolate_variables_into_string(goldmsg, &symbols);
|
||||
// Note that both strings are the same in english, but some languages will
|
||||
// want to translate them differently.
|
||||
const std::string goldmsg = vngettext(
|
||||
"You will start the next scenario with $gold or its defined minimum starting gold, whichever is higher.",
|
||||
"You will start the next scenario with $gold or its defined minimum starting gold, whichever is higher.",
|
||||
player->gold, symbols);
|
||||
|
||||
// xgettext:no-c-format
|
||||
report << '\n' << goldmsg;
|
||||
|
|
Loading…
Add table
Reference in a new issue