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);
75 toggle_button& show_all_toggle = find_widget<toggle_button>(
"show_all");
76 listbox& list = find_widget<listbox>(
"language_list");
87 listbox& list = find_widget<listbox>(
"language_list");
90 toggle_button& show_all_toggle = find_widget<toggle_button>(
"show_all");
96 for(
const auto& lang :
langs_) {
99 data[
"language"][
"label"] = lang.language;
100 data[
"language"][
"use_markup"] =
"true";
102 data[
"translated_total"][
"use_markup"] =
"true";
110 if(lang == current_language) {
123 const int res = find_widget<listbox>(
"language_list")
boost::dynamic_bitset complete_langs_
virtual void post_show() override
Actions to be taken after the window has been shown.
virtual void pre_show() override
Actions to be taken before showing the window.
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.
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
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.
std::string tag(const std::string &tag_name, Args &&... contents)
Returns the contents enclosed inside <tag_name> and </tag_name>
std::string span_color(const color_t &color, Args &&... data)
Returns a Pango formatting string using the provided color_t object.
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.