Author: shadowmaster
Date: Wed Mar 21 17:10:20 2012
New Revision: 53600

URL: http://svn.gna.org/viewcvs/wesnoth?rev=53600&view=rev
Log:
addon/client, addon/mg: Make more use of vgettext to reduce code verbosity

Modified:
    trunk/src/addon/client.cpp
    trunk/src/addon/manager_ui.cpp

Modified: trunk/src/addon/client.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon/client.cpp?rev=53600&r1=53599&r2=53600&view=diff
==============================================================================
--- trunk/src/addon/client.cpp (original)
+++ trunk/src/addon/client.cpp Wed Mar 21 17:10:20 2012
@@ -63,7 +63,7 @@
        conn_ = new network_asio::connection(host_, port_);
 
        this->wait_for_transfer_done(
-               utils::interpolate_variables_into_string(_("Connecting to 
$server_address|..."), &i18n_symbols));
+               vgettext("Connecting to $server_address|...", i18n_symbols));
 }
 
 bool addons_client::request_addons_list(config& cfg)
@@ -138,8 +138,7 @@
        LOG_ADDONS << "sending " << id << '\n';
 
        this->send_request(request_buf, response_buf);
-       this->wait_for_transfer_done(utils::interpolate_variables_into_string(
-               _("Sending add-on <i>$addon_title</i>..."), &i18n_symbols
+       this->wait_for_transfer_done(vgettext("Sending add-on 
<i>$addon_title</i>...", i18n_symbols
        ));
 
        if(const config& message_cfg = response_buf.child("message")) {
@@ -173,8 +172,7 @@
        LOG_ADDONS << "requesting server to delete " << id << '\n';
 
        this->send_request(request_buf, response_buf);
-       this->wait_for_transfer_done(utils::interpolate_variables_into_string(
-               _("Removing add-on <i>$addon_title</i> from the server..."), 
&i18n_symbols
+       this->wait_for_transfer_done(vgettext("Removing add-on 
<i>$addon_title</i> from the server...", i18n_symbols
        ));
 
        if(const config& message_cfg = response_buf.child("message")) {
@@ -198,8 +196,7 @@
        LOG_ADDONS << "downloading " << id << '\n';
 
        this->send_request(request_buf, archive_cfg);
-       this->wait_for_transfer_done(utils::interpolate_variables_into_string(
-               _("Downloading add-on <i>$addon_title</i>..."), &i18n_symbols));
+       this->wait_for_transfer_done(vgettext("Downloading add-on 
<i>$addon_title</i>...", i18n_symbols));
 
        return !this->update_last_error(archive_cfg);
 }
@@ -213,9 +210,8 @@
 
        if(!check_names_legal(archive_cfg)) {
                gui2::show_error_message(disp_.video(),
-                       utils::interpolate_variables_into_string(
-                               _("The add-on <i>$addon_title</i> has an 
invalid file or directory "
-                                 "and cannot be installed."), &i18n_symbols));
+                       vgettext("The add-on <i>$addon_title</i> has an invalid 
file or directory "
+                               "and cannot be installed.", i18n_symbols));
                return false;
        }
 

Modified: trunk/src/addon/manager_ui.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon/manager_ui.cpp?rev=53600&r1=53599&r2=53600&view=diff
==============================================================================
--- trunk/src/addon/manager_ui.cpp (original)
+++ trunk/src/addon/manager_ui.cpp Wed Mar 21 17:10:20 2012
@@ -277,8 +277,7 @@
 
        utils::string_map symbols;
        symbols["addon"] = make_addon_title(addon_id); // FIXME: need the real 
title!
-       const std::string& text = utils::interpolate_variables_into_string(
-               _("You seem to be the author of '$addon|'. Downloading it again 
from the server will overwrite any changes you have made since the last upload, 
and it may also delete your pbl file. Do you really wish to continue?"), 
&symbols);
+       const std::string& text = vgettext("You seem to be the author of 
'$addon|'. Downloading it again from the server will overwrite any changes you 
have made since the last upload, and it may also delete your pbl file. Do you 
really wish to continue?", symbols);
 
        return gui2::show_message(video, _("Confirm"), text, 
gui2::tmessage::yes_no_buttons) == gui2::twindow::OK;
 }
@@ -288,8 +287,7 @@
 {
        utils::string_map symbols;
        symbols["addon"] = make_addon_title(addon_id); // FIXME: need the real 
title!
-       const std::string& text = utils::interpolate_variables_into_string(
-               _("Deleting '$addon|' will permanently erase its download and 
upload counts on the add-ons server. Do you really wish to continue?"), 
&symbols);
+       const std::string& text = vgettext("Deleting '$addon|' will permanently 
erase its download and upload counts on the add-ons server. Do you really wish 
to continue?", symbols);
 
        const int res = gui2::show_message(
                video, _("Confirm"), text, gui2::tmessage::yes_no_buttons);


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to