help: Fix ToD Schedule topic index heading not being translatable

Again, someone forgot to make this translatable. Fortunately, for 1.14
we can rely on a very simple hack to borrow the same string from the
wesnoth-help textdomain, which is actually supposed to be used for the
same purpose as it is the top-level section's title there, which is also
supposed to be the heading for the section's index.

This kind of thing just goes to show how badly organized the whole help
system is code-wise.
This commit is contained in:
Iris Morelle 2018-03-31 06:36:37 -03:00
parent 4cd98821a9
commit e9105ab8a7
2 changed files with 13 additions and 2 deletions

View file

@ -16,6 +16,8 @@
(bug #2732)
* Fixed "Search" placeholder text in dialog item filters not being
translatable (bug #2709, bug #2732).
* Fixed "Time of Day Schedule" heading for the index for the ToD Schedule
top-level help section not being translatable.
* Updated translations: British English, Chinese (Simplified),
Scottish Gaelic, Spanish, Ukrainian
### Miscellaneous and bug fixes

View file

@ -361,9 +361,18 @@ std::vector<topic> generate_time_of_day_topics(const bool /*sort_generated*/)
std::vector<topic> topics;
std::stringstream toplevel;
// HACK: Wesnoth 1.14 only, to avoid breaking a string freeze in the middle
// of the RC phase. The string already exists in the wesnoth-help
// (WML) textdomain and it's used for the help sections tree on the
// left. It was supposed to be used here as well but someone forgot
// to mark the string translatable. Future versions will just use the
// regular textdomain for this file.
const std::string& tod_schedule_heading =
translation::dsgettext("wesnoth-help", "Time of Day Schedule");
if (! resources::tod_manager) {
toplevel << N_("Only available during a scenario.");
topics.emplace_back("Time of Day Schedule", "..schedule", toplevel.str());
topics.emplace_back(tod_schedule_heading, "..schedule", toplevel.str());
return topics;
}
const std::vector<time_of_day>& times = resources::tod_manager->times();
@ -384,7 +393,7 @@ std::vector<topic> generate_time_of_day_topics(const bool /*sort_generated*/)
topics.emplace_back(time.name.str(), id, text.str());
}
topics.emplace_back("Time of Day Schedule", "..schedule", toplevel.str());
topics.emplace_back(tod_schedule_heading, "..schedule", toplevel.str());
return topics;
}