| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | let str_startdate = jQuery('#log_delete_records_startdate').val(); |
| 16 | 16 | let str_enddate = jQuery('#log_delete_records_enddate').val(); |
| 17 | 17 | let errors = []; |
| 18 | 18 | if (str_startdate == '' || str_enddate == '') { |
| 19 | - errors.push(__('Please select Start Date and End Date.')); | |
| 19 | + errors.push(MainWP.I18n.t('Please select Start Date and End Date.')); | |
| 20 | 20 | } |
| 21 | 21 | if (errors.length > 0) { |
| 22 | 22 | mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + errors, 'red'); |
| 23 | 23 | return; |
| @@ -22,9 +22,9 @@ | ||
| 22 | 22 | mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + errors, 'red'); |
| 23 | 23 | return; |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | - let msg = __('Are you sure you want to delete logs for selected date?'); | |
| 26 | + let msg = MainWP.I18n.t('Are you sure you want to delete logs for selected date?'); | |
| 27 | 27 | |
| 28 | 28 | mainwp_confirm(msg, function () { |
| 29 | 29 | let data = mainwp_secure_data({ |
| 30 | 30 | action: 'mainwp_module_log_delete_records', |
| @@ -30,17 +30,17 @@ | ||
| 30 | 30 | action: 'mainwp_module_log_delete_records', |
| 31 | 31 | startdate: jQuery('#log_delete_records_startdate').val(), |
| 32 | 32 | enddate: jQuery('#log_delete_records_enddate').val(), |
| 33 | 33 | }); |
| 34 | - mainwp_set_message_zone('#mainwp-message-zone', __('Running ...'), 'green'); | |
| 34 | + mainwp_set_message_zone('#mainwp-message-zone', MainWP.I18n.t('Running ...'), 'green'); | |
| 35 | 35 | jQuery.post(ajaxurl, data, function (response) { |
| 36 | 36 | mainwp_set_message_zone('#mainwp-message-zone'); |
| 37 | 37 | if (response.error) { |
| 38 | 38 | mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + response.error, 'red'); |
| 39 | 39 | } else if (response.result) { |
| 40 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Logs records has been deleted successfully.'), 'green'); | |
| 40 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Logs records has been deleted successfully.'), 'green'); | |
| 41 | 41 | } else { |
| 42 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Undefined error. Please try again.'), 'red'); | |
| 42 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Undefined error. Please try again.'), 'red'); | |
| 43 | 43 | } |
| 44 | 44 | }, 'json'); |
| 45 | 45 | }); |
| 46 | 46 | |
| @@ -50,13 +50,13 @@ | ||
| 50 | 50 | jQuery('#logs_compact_records_button').on('click', function () { |
| 51 | 51 | let year = jQuery('#mainwp_module_log_compact_year').dropdown('get value'); |
| 52 | 52 | mainwp_set_message_zone('#mainwp-message-zone'); |
| 53 | 53 | if (0 == year) { |
| 54 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Please select year.'), 'red'); | |
| 54 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Please select year.'), 'red'); | |
| 55 | 55 | return; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - let msg = __('Are you sure you want to compact logs for selected year?'); | |
| 58 | + let msg = MainWP.I18n.t('Are you sure you want to compact logs for selected year?'); | |
| 59 | 59 | |
| 60 | 60 | mainwp_confirm(msg, function () { |
| 61 | 61 | let data = mainwp_secure_data({ |
| 62 | 62 | action: 'mainwp_module_log_compact_records', |
| @@ -61,17 +61,17 @@ | ||
| 61 | 61 | let data = mainwp_secure_data({ |
| 62 | 62 | action: 'mainwp_module_log_compact_records', |
| 63 | 63 | year: year, |
| 64 | 64 | }); |
| 65 | - mainwp_set_message_zone('#mainwp-message-zone', __('Running ...'), 'green'); | |
| 65 | + mainwp_set_message_zone('#mainwp-message-zone', MainWP.I18n.t('Running ...'), 'green'); | |
| 66 | 66 | jQuery.post(ajaxurl, data, function (response) { |
| 67 | 67 | mainwp_set_message_zone('#mainwp-message-zone'); |
| 68 | 68 | if (response.error) { |
| 69 | 69 | mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + response.error, 'red'); |
| 70 | 70 | } else if (response.result) { |
| 71 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Logs records has been compact successfully.'), 'green'); | |
| 71 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Logs records has been compact successfully.'), 'green'); | |
| 72 | 72 | } else { |
| 73 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Undefined error. Please try again.'), 'red'); | |
| 73 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Undefined error. Please try again.'), 'red'); | |
| 74 | 74 | } |
| 75 | 75 | }, 'json'); |
| 76 | 76 | }); |
| 77 | 77 | return false; |
| @@ -79,9 +79,9 @@ | ||
| 79 | 79 | |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | jQuery('.mainwp-acts-logs-big-child-db-cleanup-btn').on('click', function () { |
| 83 | - let msg = __('Are you sure you want to clean up activity logs for the selected site?'); | |
| 83 | + let msg = MainWP.I18n.t('Are you sure you want to clean up activity logs for the selected site?'); | |
| 84 | 84 | mainwp_confirm(msg, () => { |
| 85 | 85 | let data = mainwp_secure_data({ |
| 86 | 86 | action: 'mainwp_module_log_clean_up_child_logs', |
| 87 | 87 | siteid: jQuery(this).data('siteid'), |
| @@ -90,19 +90,19 @@ | ||
| 90 | 90 | $(this).attr('disabled', 'disabled'); |
| 91 | 91 | |
| 92 | 92 | let btn = $(this); |
| 93 | 93 | |
| 94 | - mainwp_set_message_zone('#mainwp-message-zone', __('Running ...'), 'green'); | |
| 94 | + mainwp_set_message_zone('#mainwp-message-zone', MainWP.I18n.t('Running ...'), 'green'); | |
| 95 | 95 | jQuery.post(ajaxurl, data, function (response) { |
| 96 | 96 | mainwp_set_message_zone('#mainwp-message-zone'); |
| 97 | 97 | if (response?.error) { |
| 98 | 98 | mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + response.error, 'red'); |
| 99 | 99 | } else if (response?.success) { |
| 100 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Log records were cleaned up successfully.'), 'green'); | |
| 100 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Log records were cleaned up successfully.'), 'green'); | |
| 101 | 101 | $(btn).closest('.item').fadeOut(3000); |
| 102 | 102 | return; |
| 103 | 103 | } else { |
| 104 | - mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + __('Undefined error. Please try again.'), 'red'); | |
| 104 | + mainwp_set_message_zone('#mainwp-message-zone', '<i class="close icon"></i>' + MainWP.I18n.t('Undefined error. Please try again.'), 'red'); | |
| 105 | 105 | } |
| 106 | 106 | $(btn).attr('disabled', false); |
| 107 | 107 | }, 'json'); |
| 108 | 108 | }); |