From 6aab4e60aeede4130927b10b78aec34f9e470912 Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 26 Apr 2017 09:50:42 +0200 Subject: [PATCH] Added buttons text to translate them --- .../update_manager/update_manager.offline.php | 5 + .../include/functions_update_manager.php | 5 + .../include/javascript/update_manager.js | 239 +++++++++++------- 3 files changed, 152 insertions(+), 97 deletions(-) diff --git a/pandora_console/godmode/update_manager/update_manager.offline.php b/pandora_console/godmode/update_manager/update_manager.offline.php index c6843034f3..71ac5e8922 100644 --- a/pandora_console/godmode/update_manager/update_manager.offline.php +++ b/pandora_console/godmode/update_manager/update_manager.offline.php @@ -54,6 +54,7 @@ $baseurl = ui_get_full_url(false, false, false, false); var package_success = "\n"; var package_error = "\n"; var bad_mr_file = "\n"; + var mr_available_header = "\n"; var text1_mr_file = "\n"; var text2_mr_file = "\n"; var text3_mr_file = "\n"; @@ -61,6 +62,10 @@ $baseurl = ui_get_full_url(false, false, false, false); var text1_package_file = "\n"; var text2_package_file = "\n"; var applying_mr = "\n"; + var cancel_button = "\n"; + var ok_button = "\n"; + var apply_mr_button = "\n"; + var apply_button = "\n";
diff --git a/pandora_console/include/functions_update_manager.php b/pandora_console/include/functions_update_manager.php index cc18c542eb..51eb3657e8 100755 --- a/pandora_console/include/functions_update_manager.php +++ b/pandora_console/include/functions_update_manager.php @@ -354,6 +354,7 @@ function update_manager_check_online_free_packages ($is_ajax=true) { var package_success = "\n"; var package_error = "\n"; var bad_mr_file = "\n"; + var mr_available_header = "\n"; var text1_mr_file = "\n"; var text2_mr_file = "\n"; var text3_mr_file = "\n"; @@ -361,6 +362,10 @@ function update_manager_check_online_free_packages ($is_ajax=true) { var text1_package_file = "\n"; var text2_package_file = "\n"; var applying_mr = "\n"; + var cancel_button = "\n"; + var ok_button = "\n"; + var apply_mr_button = "\n"; + var apply_button = "\n"; ").dialog ({ @@ -263,11 +266,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_accept_package_mr_fail_text = "
"; @@ -306,11 +310,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_success_pkg_text = "
"; @@ -337,11 +342,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_pkg_text = "
"; @@ -366,8 +372,11 @@ function install_package (package, homeurl) { // Check the status of the update check_install_package(package, homeurl); - }, - "Cancel": function () { + } + }, + { + text:cancel_button, + click: function () { $(this).dialog("close"); $("
").dialog ({ @@ -380,11 +389,12 @@ function install_package (package, homeurl) { }, width: 600, height: 220, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_cancel_pkg_text = "
"; @@ -401,7 +411,7 @@ function install_package (package, homeurl) { $('#form-offline_update ul').find('li').find('p').html(mr_not_accepted) .append(""+data.message+""); } - } + }] }); var dialog_bad_message_text = "
"; @@ -425,11 +435,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_success_mr_text = "
"; @@ -468,11 +479,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_success_pkg_text = "
"; @@ -499,11 +511,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_pkg_text = "
"; @@ -544,11 +557,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_mr_text = "
"; @@ -564,8 +578,11 @@ function install_package (package, homeurl) { $('#form-offline_update ul').find('li').find('p').html(error_in_mr) .append(""+data.message+""); } - }, - "Cancel": function () { + } + }, + { + text:cancel_button, + click: function () { $("#mr_dialog2").dialog("close"); $("
").dialog ({ @@ -578,11 +595,12 @@ function install_package (package, homeurl) { }, width: 600, height: 220, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_cancel_mr_text = "
"; @@ -599,7 +617,7 @@ function install_package (package, homeurl) { $('#form-offline_update ul').find('li').find('p').html(mr_not_accepted) .append(""+data.message+""); } - } + }] }); $('button:contains(Apply MR)').attr("id","apply_rr_button"); @@ -607,7 +625,7 @@ function install_package (package, homeurl) { var dialog_have_mr_text = "
"; dialog_have_mr_text = dialog_have_mr_text + "
"; - dialog_have_mr_text = dialog_have_mr_text + "

This package includes db changes

"; + dialog_have_mr_text = dialog_have_mr_text + "

" + mr_available_header + "

"; dialog_have_mr_text = dialog_have_mr_text + "

" + text1_mr_file + "

"; dialog_have_mr_text = dialog_have_mr_text + "

" + text2_mr_file + "" + text3_mr_file + "" + text4_mr_file + "

"; dialog_have_mr_text = dialog_have_mr_text + "
"; @@ -645,11 +663,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_success_pkg_text = "
"; @@ -676,11 +695,12 @@ function install_package (package, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_pkg_text = "
"; @@ -710,8 +730,11 @@ function install_package (package, homeurl) { } } }); - }, - "Cancel": function () { + } + }, + { + text:cancel_button, + click: function () { $(this).dialog("close"); $("
").dialog ({ @@ -724,11 +747,12 @@ function install_package (package, homeurl) { }, width: 600, height: 220, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_cancel_pkg_text = "
"; @@ -781,7 +805,7 @@ function install_package (package, homeurl) { // Check the status of the update check_install_package(package, homeurl); } - } + }] }); var dialog_text = "
"; @@ -964,8 +988,9 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "OK": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); var parameters = {}; @@ -991,8 +1016,9 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 270, - buttons: { - "Apply MR": function () { + buttons: [{ + text:apply_mr_button, + click: function () { var err = []; err = apply_minor_release(data['mr'], package, 0, 0, home_url); if (!err['error']) { @@ -1008,8 +1034,9 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 270, - buttons: { - "Apply": function() { + buttons: [{ + text:apply_button, + click: function() { $(this).dialog("close"); $("
").dialog ({ @@ -1022,11 +1049,12 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_accept_package_mr_fail_text = "
"; @@ -1066,8 +1094,11 @@ function install_free_package_prev_step(package, version, homeurl) { ); remove_rr_file_to_extras(home_url); - }, - "Cancel": function () { + } + }, + { + text:cancel_button, + click: function () { $(this).dialog("close"); $(this).dialog("close"); @@ -1082,11 +1113,12 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 220, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_cancel_pkg_text = "
"; @@ -1100,7 +1132,7 @@ function install_free_package_prev_step(package, version, homeurl) { $("#box_online .content").html(package_not_accepted); } - } + }] }); var dialog_bad_message_text = "
"; @@ -1124,11 +1156,12 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_success_mr_text = "
"; @@ -1182,11 +1215,12 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_mr_text = "
"; @@ -1200,7 +1234,9 @@ function install_free_package_prev_step(package, version, homeurl) { $("#box_online .content").html(mr_error); } - }, + } + }, + { "Cancel": function () { $(this).dialog("close"); @@ -1214,11 +1250,12 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 220, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_cancel_mr_text = "
"; @@ -1234,7 +1271,7 @@ function install_free_package_prev_step(package, version, homeurl) { $("#box_online .downloading_package").hide(); $("#box_online .content").html("MR not accepted"); } - } + }] }); $('button:contains(Apply MR)').attr("id","apply_rr_button"); @@ -1242,7 +1279,7 @@ function install_free_package_prev_step(package, version, homeurl) { var dialog_have_mr_text = "
"; dialog_have_mr_text = dialog_have_mr_text + "
"; - dialog_have_mr_text = dialog_have_mr_text + "

This package includes db changes

"; + dialog_have_mr_text = dialog_have_mr_text + "

" + mr_available_header + "

"; dialog_have_mr_text = dialog_have_mr_text + "

" + text1_mr_file + "

"; dialog_have_mr_text = dialog_have_mr_text + "

" + text2_mr_file + "" + text3_mr_file + "" + text4_mr_file + "

"; dialog_have_mr_text = dialog_have_mr_text + "
"; @@ -1283,8 +1320,11 @@ function install_free_package_prev_step(package, version, homeurl) { }, "json" ); - }, - "Cancel": function () { + } + }, + { + text:cancel_button, + click: function () { $(this).dialog("close"); $("
").dialog ({ @@ -1297,11 +1337,12 @@ function install_free_package_prev_step(package, version, homeurl) { }, width: 600, height: 220, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_cancel_pkg_text = "
"; @@ -1317,7 +1358,7 @@ function install_free_package_prev_step(package, version, homeurl) { $("#box_online .progressbar").hide(); $("#box_online .content").html(package_cancel); } - } + }] }); var dialog_text = "
"; @@ -1356,11 +1397,12 @@ function install_free_package(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_pkg_text = "
"; @@ -1392,11 +1434,12 @@ function install_free_package(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_success_pkg_text = "
"; @@ -1426,11 +1469,12 @@ function install_free_package(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_pkg_text = "
"; @@ -1461,11 +1505,12 @@ function install_free_package(package, version, homeurl) { }, width: 600, height: 250, - buttons: { - "Ok": function () { + buttons: [{ + text:ok_button, + click: function () { $(this).dialog("close"); } - } + }] }); var dialog_error_pkg_text = "
";