Skip to content

Commit

Permalink
Make chat room names localizable (#2709)
Browse files Browse the repository at this point in the history
  • Loading branch information
jyrkive committed Aug 7, 2018
1 parent a6bd0c8 commit 1eec7ef
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/gui/dialogs/multiplayer/lobby.cpp
Expand Up @@ -788,7 +788,7 @@ void mp_lobby::pre_show(window& window)
*filter_text_,
std::bind(&mp_lobby::game_filter_keypress_callback, this, _5));

chatbox_->room_window_open("lobby", true, false);
chatbox_->room_window_open(N_("lobby"), true, false);
chatbox_->active_window_changed();
game_filter_reload();

Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/multiplayer/mp_join_game.cpp
Expand Up @@ -243,7 +243,7 @@ void mp_join_game::pre_show(window& window)
chat.set_lobby_info(lobby_info_);
chat.set_wesnothd_connection(network_connection_);

chat.room_window_open("this game", true, false); // TODO: better title?
chat.room_window_open(N_("this game"), true, false);
chat.active_window_changed();
chat.load_log(default_chat_log, false);

Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/multiplayer/mp_staging.cpp
Expand Up @@ -101,7 +101,7 @@ void mp_staging::pre_show(window& window)
chat.set_wesnothd_connection(*network_connection_);
}

chat.room_window_open("this game", true, false); // TODO: better title?
chat.room_window_open(N_("this game"), true, false);
chat.active_window_changed();
chat.load_log(default_chat_log, false);

Expand Down
4 changes: 2 additions & 2 deletions src/gui/widgets/chatbox.cpp
Expand Up @@ -379,9 +379,9 @@ bool chatbox::room_window_active(const std::string& room)
return t.name == room && t.whisper == false;
}

lobby_chat_window* chatbox::room_window_open(const std::string& room, const bool open_new, const bool allow_close)
lobby_chat_window* chatbox::room_window_open(const t_string& room, const bool open_new, const bool allow_close)
{
return find_or_create_window(room, false, open_new, allow_close,
return find_or_create_window(room.base_str(), false, open_new, allow_close,
VGETTEXT("Room <i>“$name”</i> joined", { { "name", room } }));
}

Expand Down
3 changes: 2 additions & 1 deletion src/gui/widgets/chatbox.hpp
Expand Up @@ -18,6 +18,7 @@
#include "game_initialization/lobby_data.hpp"
#include "game_initialization/lobby_info.hpp"
#include "gui/widgets/container_base.hpp"
#include "tstring.hpp"

#include <map>
#include <string>
Expand Down Expand Up @@ -231,7 +232,7 @@ class chatbox : public container_base, public events::chat_handler
* 'close' button will be disabled.
* @return valid ptr if the window was found or added, null otherwise
*/
lobby_chat_window* room_window_open(const std::string& room,
lobby_chat_window* room_window_open(const t_string& room,
const bool open_new, const bool allow_close = true);

/**
Expand Down

0 comments on commit 1eec7ef

Please sign in to comment.