16 #define GETTEXT_DOMAIN "wesnoth-lib"
35 const std::string translations_wiki_url =
"https://wiki.wesnoth.org/WesnothTranslations";
37 const std::string translations_stats_url =
"https://gettext.wesnoth.org/";
46 , complete_langs_(langs_.
size())
53 for(std::size_t
i = 0;
i < langs_.size(); ++
i) {
54 if(langs_[
i] == current_language) {
58 complete_langs_[
i] =
true;
67 register_bool(
"show_all",
true, show_all);
69 register_label(
"contrib_url",
true, translations_wiki_url,
true);
70 register_label(
"stats_url",
true, translations_stats_url,
true);
78 listbox& list = find_widget<listbox>(&
window,
"language_list",
false);
89 listbox& list = find_widget<listbox>(&
window,
"language_list",
false);
98 for(
const auto& lang :
langs_) {
101 data[
"language"][
"label"] = lang.language;
102 data[
"language"][
"use_markup"] =
"true";
104 data[
"translated_total"][
"use_markup"] =
"true";
107 data[
"language"][
"label"] +=
"\n<small><tt>" + lang.localename +
"</tt></small>";
112 if(lang == current_language) {
125 const int res = find_widget<listbox>(&
window,
"language_list",
false)
virtual void post_show(window &window) override
Actions to be taken after the window has been shown.
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
boost::dynamic_bitset complete_langs_
const std::vector< language_def > langs_
void shown_filter_callback()
Abstract base class for all modal dialogs.
int get_retval() const
Returns the cached window exit code.
window * get_window()
Returns a pointer to the dialog's window.
bool select_last_row(const bool select=true)
Does exactly as advertised: selects the list's last row.
void set_row_shown(const unsigned row, const bool shown)
Makes a row visible or invisible.
grid & add_row(const widget_item &item, const int index=-1)
When an item in the list is selected by the user we need to update the state.
bool get_value_bool() const
base class of top level items, the only item which needs to store the final canvases to draw on.
void keyboard_capture(widget *widget)
int get_min_translation_percent()
const language_def & get_language()
language_list get_languages(bool all)
Return a list of available translations.
color_t red_to_green(double val, bool for_text)
Return a color corresponding to the value val red for val=0.0 to green for val=100....
REGISTER_DIALOG(editor_edit_unit)
void connect_signal_mouse_left_click(dispatcher &dispatcher, const signal &signal)
Connects a signal handler for a left mouse button click.
std::map< std::string, widget_item > widget_data
@ OK
Dialog was closed with the OK button.
void set_language(const std::string &language, const std::vector< std::string > *)
std::size_t size(const std::string &str)
Length in characters of a UTF-8 string.
std::string to_hex_string() const
Returns the stored color in rrggbb hex format.