Skip to content

Commit

Permalink
save_index: Move a space out of a translatable string.
Browse files Browse the repository at this point in the history
The string _("replay") is already used elsewhere, so this prevents two kinds of bugs from
happening:

- Translating _("replay") and _(" replay") differently
- Translating _(" replay") without the leading space

14 po files got this wrong in one way or another.
  • Loading branch information
jostephd committed Sep 30, 2019
1 parent e684850 commit 5bbc7a6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/save_index.cpp
Expand Up @@ -233,18 +233,19 @@ std::string save_info::format_time_summary() const

bool save_info_less_time::operator()(const save_info& a, const save_info& b) const
{
const std::string replay_str = " " + _("replay");
if(a.modified() > b.modified()) {
return true;
} else if(a.modified() < b.modified()) {
return false;
} else if(a.name().find(_(" replay")) == std::string::npos && b.name().find(_(" replay")) != std::string::npos) {
} else if(a.name().find(replay_str) == std::string::npos && b.name().find(replay_str) != std::string::npos) {
// Special funky case; for files created in the same second,
// a replay file sorts less than a non-replay file. Prevents
// a timing-dependent bug where it may look like, at the end
// of a scenario, the replay and the autosave for the next
// scenario are displayed in the wrong order.
return true;
} else if(a.name().find(_(" replay")) != std::string::npos && b.name().find(_(" replay")) == std::string::npos) {
} else if(a.name().find(replay_str) != std::string::npos && b.name().find(replay_str) == std::string::npos) {
return false;
} else {
return a.name() > b.name();
Expand Down

0 comments on commit 5bbc7a6

Please sign in to comment.