Skip to content

Commit

Permalink
addon/mg: Choose "update" vs. "install" terms when using Update All too
Browse files Browse the repository at this point in the history
Previously the "update" terminology was only used when the Upgradable
view was the active view. Now that the Update All action may be
available on other views, we need to take care to use the correct terms
for it too.

This commit incurs in no changes to existing translatable strings.
  • Loading branch information
irydacea committed Jul 8, 2014
1 parent c895105 commit e98d21f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/addon/manager_ui.cpp
Expand Up @@ -893,22 +893,26 @@ void show_addons_manager_dialog(display& disp, addons_client& client, addons_lis
const char* msg_title = NULL;
const char* msg_text = NULL;

// Use the Update terminology when using Update All or working with the
// Upgradable add-ons view.
const bool updating = update_everything || updates_only;

if(ids_to_install.size() == 1 && failed_titles.empty()) {
utils::string_map syms;
syms["addon_title"] = addons[ids_to_install[0]].title;

msg_title = !updates_only ? _("Add-on Installed") : _("Add-on Updated");
msg_text = !updates_only ? _("The add-on '$addon_title|' has been successfully installed.") : _("The add-on '$addon_title|' has been successfully updated.");
msg_title = !updating ? _("Add-on Installed") : _("Add-on Updated");
msg_text = !updating ? _("The add-on '$addon_title|' has been successfully installed.") : _("The add-on '$addon_title|' has been successfully updated.");

gui2::show_transient_message(disp.video(),
msg_title, utils::interpolate_variables_into_string(msg_text, &syms));
} else if(failed_titles.empty()) {
msg_title = !updates_only ? _("Add-ons Installed") : _("Add-ons Updated");
msg_text = !updates_only ? _("All add-ons installed successfully.") : _("All add-ons updated successfully.");
msg_title = !updating ? _("Add-ons Installed") : _("Add-ons Updated");
msg_text = !updating ? _("All add-ons installed successfully.") : _("All add-ons updated successfully.");

gui2::show_transient_message(disp.video(), msg_title, msg_text);
} else {
msg_title = !updates_only ? _("Installation Failed") : _("Update Failed");
msg_title = !updating ? _("Installation Failed") : _("Update Failed");
msg_text = _n(
"The following add-on could not be downloaded or installed successfully:",
"The following add-ons could not be downloaded or installed successfully:",
Expand Down

0 comments on commit e98d21f

Please sign in to comment.