Skip to content

Commit

Permalink
MP Create Game: fixed campaign player numbers label being untranslatable
Browse files Browse the repository at this point in the history
Fixes #2861.

Also changed the logic for when the "min to max" label is shown from != to >.
  • Loading branch information
Vultraz committed Apr 10, 2018
1 parent c23fc2b commit a4dd74c
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/gui/dialogs/multiplayer/mp_create_game.cpp
Expand Up @@ -34,6 +34,7 @@
#include "gui/widgets/listbox.hpp"
#endif
#include "formatter.hpp"
#include "formula/string_utils.hpp"
#include "game_config.hpp"
#include "gui/widgets/minimap.hpp"
#include "gui/widgets/settings.hpp"
Expand Down Expand Up @@ -727,14 +728,15 @@ void mp_create_game::update_details(window& win)
find_widget<stacked_widget>(&win, "minimap_stack", false).select_layer(1);
find_widget<image>(&win, "campaign_image", false).set_image(img);

std::stringstream players_str;
players_str << current_campaign->min_players();
const int p_min = current_campaign->min_players();
const int p_max = current_campaign->max_players();

if(current_campaign->max_players() != current_campaign->min_players()) {
players_str << " to " << current_campaign->max_players();
if(p_max > p_min) {
players.set_label(VGETTEXT("$min to $max", {{"min", std::to_string(p_min)}, {"max", std::to_string(p_max)}}));
} else {
players.set_label(std::to_string(p_min));
}

players.set_label(players_str.str());
map_size.set_label(font::unicode_em_dash);

break;
Expand Down

0 comments on commit a4dd74c

Please sign in to comment.