| @@ -55,9 +55,9 @@ | ||
| 55 | 55 | loadFilesBeforeZip: loadFilesBeforeZip, |
| 56 | 56 | subfolder: jQuery('#backup_subfolder').val() |
| 57 | 57 | }, true); |
| 58 | 58 | |
| 59 | - mainwpPopup('#managesite-backup-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + __('Creating the backup file on the child site, this might take a while depending on the size. Please be patient.') + ' <div id="managesite-createbackup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 59 | + mainwpPopup('#managesite-backup-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + MainWP.I18n.t('Creating the backup file on the child site, this might take a while depending on the size. Please be patient.') + ' <div id="managesite-createbackup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 60 | 60 | jQuery('#managesite-createbackup-status-progress').progress({ value: 0, total: size }); |
| 61 | 61 | |
| 62 | 62 | mainwpPopup('#managesite-backup-status-box').init({ |
| 63 | 63 | callback: function () { |
| @@ -135,9 +135,9 @@ | ||
| 135 | 135 | |
| 136 | 136 | let progressBar = jQuery('#managesite-createbackup-status-progress'); |
| 137 | 137 | progressBar.progress('set progress', parseFloat(progressBar.progress('get total'))); |
| 138 | 138 | |
| 139 | - appendToDiv(backsprocessContentEl, __('Backup file on child site created successfully!')); | |
| 139 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backup file on child site created successfully!')); | |
| 140 | 140 | |
| 141 | 141 | backup_download_file(pSiteId, pType, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, pRemoteDestinations); |
| 142 | 142 | } |
| 143 | 143 | } |
| @@ -174,9 +174,9 @@ | ||
| 174 | 174 | let progressBar = jQuery('#managesite-createbackup-status-progress'); |
| 175 | 175 | progressBar.progress('set progress', parseFloat(progressBar.progress('get total'))); |
| 176 | 176 | |
| 177 | 177 | //download!!! |
| 178 | - appendToDiv(backsprocessContentEl, __('Backup file on child site created successfully!')); | |
| 178 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backup file on child site created successfully!')); | |
| 179 | 179 | |
| 180 | 180 | backup_download_file(siteId, type, response.result.file, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, remoteDestinations); |
| 181 | 181 | } else if (response.status == 'stalled') { |
| 182 | 182 | backupContinueRetries++; |
| @@ -206,9 +206,9 @@ | ||
| 206 | 206 | |
| 207 | 207 | let progressBar = jQuery('#managesite-createbackup-status-progress'); |
| 208 | 208 | progressBar.progress('set progress', parseFloat(progressBar.progress('get total'))); |
| 209 | 209 | |
| 210 | - appendToDiv(backsprocessContentEl, __('Backupfile on child site created successfully.')); | |
| 210 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backupfile on child site created successfully.')); | |
| 211 | 211 | |
| 212 | 212 | backup_download_file(pSiteId, pType, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, pRemoteDestinations); |
| 213 | 213 | } |
| 214 | 214 | } |
| @@ -248,9 +248,9 @@ | ||
| 248 | 248 | }; |
| 249 | 249 | |
| 250 | 250 | backup_download_file = function (pSiteId, type, url, file, regexfile, size, subfolder, remote_destinations) { |
| 251 | 251 | let backsprocessContentEl = mainwpPopup('#managesite-backup-status-box').getContentEl(); |
| 252 | - appendToDiv(backsprocessContentEl, __('Downloading the file.') + ' <div id="managesite-backup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 252 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Downloading the file.') + ' <div id="managesite-backup-status-progress" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 253 | 253 | jQuery('#managesite-backup-status-progress').progress({ value: 0, total: size }); |
| 254 | 254 | |
| 255 | 255 | let fnc = function (file) { |
| 256 | 256 | return function (pFunction) { |
| @@ -319,9 +319,9 @@ | ||
| 319 | 319 | backupDownloadRunning = false; |
| 320 | 320 | |
| 321 | 321 | if (response.error) { |
| 322 | 322 | appendToDiv(backsprocessContentEl, '<span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>'); |
| 323 | - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Backup failed!') + '</span>'); | |
| 323 | + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Backup failed!') + '</span>'); | |
| 324 | 324 | |
| 325 | 325 | jQuery('#managesite-backup-status-close').prop('value', 'Close'); |
| 326 | 326 | return; |
| 327 | 327 | } |
| @@ -326,9 +326,9 @@ | ||
| 326 | 326 | return; |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | jQuery('#managesite-backup-status-progress').progress('set progress', pSize); |
| 330 | - appendToDiv(backsprocessContentEl, __('Download from child site completed.')); | |
| 330 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Download from child site completed.')); | |
| 331 | 331 | |
| 332 | 332 | let newData = mainwp_secure_data({ |
| 333 | 333 | action: 'mainwp_backup_delete_file', |
| 334 | 334 | site_id: pSiteId, |
| @@ -356,9 +356,9 @@ | ||
| 356 | 356 | if (pRemoteDestinations.length > 0) { |
| 357 | 357 | let remote_destination = pRemoteDestinations[0]; |
| 358 | 358 | //upload.. |
| 359 | 359 | let unique = Date.now(); |
| 360 | - appendToDiv(backsprocessContentEl, __('Uploading to remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 360 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Uploading to remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 361 | 361 | |
| 362 | 362 | jQuery('#managesite-upload-status-progress-' + unique).progress({ value: 0, total: pSize }); |
| 363 | 363 | |
| 364 | 364 | let fnc = function (pUnique) { |
| @@ -441,11 +441,11 @@ | ||
| 441 | 441 | |
| 442 | 442 | let obj = response.result; |
| 443 | 443 | if (obj.error) { |
| 444 | 444 | backupError = true; |
| 445 | - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 445 | + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 446 | 446 | } else { |
| 447 | - appendToDiv(backsprocessContentEl, __('Upload to %1 (%2) successful!', obj.title, obj.type)); | |
| 447 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Upload to %1 (%2) successful!', obj.title, obj.type)); | |
| 448 | 448 | } |
| 449 | 449 | |
| 450 | 450 | backup_upload_file(pSiteId, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize); |
| 451 | 451 | } |
| @@ -458,9 +458,9 @@ | ||
| 458 | 458 | }(pSiteId, pRemoteDestinations, pFile, pRegexFile, pSubfolder, pType, pSize, data, unique, remote_destination.id), |
| 459 | 459 | dataType: 'json' |
| 460 | 460 | }); |
| 461 | 461 | } else { |
| 462 | - appendToDiv(backsprocessContentEl, __('Backup completed!')); | |
| 462 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Backup completed!')); | |
| 463 | 463 | jQuery('#managesite-backup-status-close').prop('value', 'Close'); |
| 464 | 464 | if (!backupError) { |
| 465 | 465 | setTimeout(function () { |
| 466 | 466 | mainwpPopup('#managesite-backup-status-box').close(true); |
| @@ -489,9 +489,9 @@ | ||
| 489 | 489 | |
| 490 | 490 | let progressBar = jQuery('#managesite-upload-status-progress-' + pUnique); |
| 491 | 491 | progressBar.progress('set progress', pSize); |
| 492 | 492 | |
| 493 | - appendToDiv(backsprocessContentEl, __('Upload to %1 (%2) successful!', response.info.title, response.info.type)); | |
| 493 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Upload to %1 (%2) successful!', response.info.title, response.info.type)); | |
| 494 | 494 | |
| 495 | 495 | backup_upload_file(pSiteId, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize); |
| 496 | 496 | } else if (response.status == 'stalled') { |
| 497 | 497 | if (backupContinueRetriesUnique[pUnique] == undefined) { |
| @@ -502,9 +502,9 @@ | ||
| 502 | 502 | |
| 503 | 503 | if (backupContinueRetriesUnique[pUnique] > 10) { |
| 504 | 504 | if (responseError != undefined) { |
| 505 | 505 | backupError = true; |
| 506 | - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>'); | |
| 506 | + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>'); | |
| 507 | 507 | } else { |
| 508 | 508 | appendToDiv(backsprocessContentEl, ' <span class="mainwp-red">ERROR: Upload timed out! <a href="http://docs.mainwp.com/backup-failed-php-ini-settings/">Please check this help document for more information and possible fixes</a></span>'); |
| 509 | 509 | } |
| 510 | 510 | |
| @@ -530,11 +530,11 @@ | ||
| 530 | 530 | |
| 531 | 531 | let obj = response.result; |
| 532 | 532 | if (obj.error) { |
| 533 | 533 | backupError = true; |
| 534 | - appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 534 | + appendToDiv(backsprocessContentEl, '<span class="mainwp-red">' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 535 | 535 | } else { |
| 536 | - appendToDiv(backsprocessContentEl, __('Upload to %1 (%2) successful!', obj.title, obj.type)); | |
| 536 | + appendToDiv(backsprocessContentEl, MainWP.I18n.t('Upload to %1 (%2) successful!', obj.title, obj.type)); | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | backup_upload_file(pSiteId, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize); |
| 540 | 540 | } |
| @@ -611,12 +611,12 @@ | ||
| 611 | 611 | managebackups_run_now = function (el) { |
| 612 | 612 | el = jQuery(el); |
| 613 | 613 | el.hide(); |
| 614 | 614 | el.parent().find('.backup_run_loading').show(); |
| 615 | - mainwpPopup('#managebackups-task-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + __('Starting the backup task...')); | |
| 616 | - jQuery('#managebackups-task-status-close').prop('value', __('Cancel')); | |
| 615 | + mainwpPopup('#managebackups-task-status-box').getContentEl().html(dateToHMS(new Date()) + ' ' + MainWP.I18n.t('Starting the backup task...')); | |
| 616 | + jQuery('#managebackups-task-status-close').prop('value', MainWP.I18n.t('Cancel')); | |
| 617 | 617 | mainwpPopup('#managebackups-task-status-box').init({ |
| 618 | - title: __('Running task'), callback: function () { | |
| 618 | + title: MainWP.I18n.t('Running task'), callback: function () { | |
| 619 | 619 | location.reload(); |
| 620 | 620 | } |
| 621 | 621 | }); |
| 622 | 622 | |
| @@ -644,11 +644,11 @@ | ||
| 644 | 644 | }; |
| 645 | 645 | managebackups_run_next = function () { |
| 646 | 646 | let backtaskContentEl = mainwpPopup('#managebackups-task-status-box').getContentEl(); |
| 647 | 647 | if (manageBackupTaskSites.length == 0) { |
| 648 | - appendToDiv(backtaskContentEl, __('Backup task completed') + (manageBackupsTaskError ? ' <span class="mainwp-red">' + __('with errors') + '</span>' : '') + '.'); | |
| 648 | + appendToDiv(backtaskContentEl, MainWP.I18n.t('Backup task completed') + (manageBackupsTaskError ? ' <span class="mainwp-red">' + MainWP.I18n.t('with errors') + '</span>' : '') + '.'); | |
| 649 | 649 | |
| 650 | - jQuery('#managebackups-task-status-close').prop('value', __('Close')); | |
| 650 | + jQuery('#managebackups-task-status-close').prop('value', MainWP.I18n.t('Close')); | |
| 651 | 651 | if (!manageBackupsError) { |
| 652 | 652 | setTimeout(function () { |
| 653 | 653 | mainwpPopup('#managebackups-task-status-box').close(true); |
| 654 | 654 | }, 3000); |
| @@ -659,9 +659,9 @@ | ||
| 659 | 659 | let siteId = manageBackupTaskSites[0]['id']; |
| 660 | 660 | let siteName = manageBackupTaskSites[0]['name']; |
| 661 | 661 | let size = manageBackupTaskSites[0][manageBackupsTaskType + 'size']; |
| 662 | 662 | let fileNameUID = mainwp_uid(); |
| 663 | - appendToDiv(backtaskContentEl, '[' + siteName + '] ' + __('Creating backup file.') + '<div id="managebackups-task-status-create-progress" siteId="' + siteId + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 663 | + appendToDiv(backtaskContentEl, '[' + siteName + '] ' + MainWP.I18n.t('Creating backup file.') + '<div id="managebackups-task-status-create-progress" siteId="' + siteId + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 664 | 664 | |
| 665 | 665 | manageBackupTaskSites.shift(); |
| 666 | 666 | let data = mainwp_secure_data({ |
| 667 | 667 | action: 'mainwp_backuptask_run_site', |
| @@ -712,9 +712,9 @@ | ||
| 712 | 712 | appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">Error: ' + getErrorMessage(response.error) + '</span>'); |
| 713 | 713 | manageBackupsTaskError = true; |
| 714 | 714 | managebackups_run_next(); |
| 715 | 715 | } else { |
| 716 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Backup file created successfully.')); | |
| 716 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup file created successfully.')); | |
| 717 | 717 | |
| 718 | 718 | managebackups_backup_download_file(pSiteId, pSiteName, response.result.type, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder, pRemoteDestinations); |
| 719 | 719 | } |
| 720 | 720 | } |
| @@ -767,9 +767,9 @@ | ||
| 767 | 767 | clearInterval(pInterVal); |
| 768 | 768 | |
| 769 | 769 | if (response.error) { |
| 770 | 770 | appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>'); |
| 771 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + __('Backup failed!') + '</span>'); | |
| 771 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + MainWP.I18n.t('Backup failed!') + '</span>'); | |
| 772 | 772 | |
| 773 | 773 | manageBackupsError = true; |
| 774 | 774 | managebackups_run_next(); |
| 775 | 775 | return; |
| @@ -775,9 +775,9 @@ | ||
| 775 | 775 | return; |
| 776 | 776 | } |
| 777 | 777 | |
| 778 | 778 | jQuery('#managebackups-task-status-progress[siteId="' + pSiteId + '"]').progress('set progress', pSize); |
| 779 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Download from child site completed.')); | |
| 779 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Download from child site completed.')); | |
| 780 | 780 | |
| 781 | 781 | |
| 782 | 782 | let newData = mainwp_secure_data({ |
| 783 | 783 | action: 'mainwp_backup_delete_file', |
| @@ -796,9 +796,9 @@ | ||
| 796 | 796 | if (pRemoteDestinations.length > 0) { |
| 797 | 797 | let remote_destination = pRemoteDestinations[0]; |
| 798 | 798 | //upload.. |
| 799 | 799 | let unique = Date.now(); |
| 800 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Uploading to selected remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 800 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Uploading to selected remote destination: %1 (%2)', remote_destination.title, remote_destination.type) + '<div id="managesite-upload-status-progress-' + unique + '" class="ui green progress"><div class="bar"><div class="progress"></div></div></div>'); | |
| 801 | 801 | |
| 802 | 802 | jQuery('#managesite-upload-status-progress-' + unique).progress({ value: 0, total: pSize }); |
| 803 | 803 | |
| 804 | 804 | let fnc = function (pUnique) { |
| @@ -881,11 +881,11 @@ | ||
| 881 | 881 | |
| 882 | 882 | let obj = response.result; |
| 883 | 883 | if (obj.error) { |
| 884 | 884 | manageBackupsError = true; |
| 885 | - appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 885 | + appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 886 | 886 | } else { |
| 887 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Upload to %1 (%2) successful', obj.title, obj.type)); | |
| 887 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) successful', obj.title, obj.type)); | |
| 888 | 888 | } |
| 889 | 889 | |
| 890 | 890 | managebackups_backup_upload_file(pSiteId, pSiteName, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize); |
| 891 | 891 | } |
| @@ -898,9 +898,9 @@ | ||
| 898 | 898 | }(pRemoteDestinations, pFile, pRegexFile, pSubfolder, pType, pSiteName, pSiteId, pSize, data, unique, remote_destination.id), |
| 899 | 899 | dataType: 'json' |
| 900 | 900 | }); |
| 901 | 901 | } else { |
| 902 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Backup completed.')); | |
| 902 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup completed.')); | |
| 903 | 903 | managebackups_run_next(); |
| 904 | 904 | } |
| 905 | 905 | }; |
| 906 | 906 | |
| @@ -923,9 +923,9 @@ | ||
| 923 | 923 | |
| 924 | 924 | let progressBar = jQuery('#managesite-upload-status-progress-' + pUnique); |
| 925 | 925 | progressBar.progress('set progress', pSize); |
| 926 | 926 | |
| 927 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Upload to %1 (%2) successful', response.info.title, response.info.type)); | |
| 927 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) successful', response.info.title, response.info.type)); | |
| 928 | 928 | |
| 929 | 929 | managebackups_backup_upload_file(pSiteId, pSiteName, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize); |
| 930 | 930 | } else if (response.status == 'busy') { |
| 931 | 931 | //Try again in 10seconds |
| @@ -941,9 +941,9 @@ | ||
| 941 | 941 | |
| 942 | 942 | if (backupContinueRetriesUnique[pUnique] > 10) { |
| 943 | 943 | if (responseError != undefined) { |
| 944 | 944 | manageBackupsError = true; |
| 945 | - appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + __('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>'); | |
| 945 | + appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) failed:', response.info.title, response.info.type) + ' ' + responseError + '</span>'); | |
| 946 | 946 | } else { |
| 947 | 947 | appendToDiv(backtaskContentEl, ' <span class="mainwp-red">[' + pSiteName + '] ERROR: Upload timed out - <a href="http://docs.mainwp.com/backup-failed-php-ini-settings/">Please check this help document for more information and possible fixes</a></span>'); |
| 948 | 948 | } |
| 949 | 949 | |
| @@ -969,11 +969,11 @@ | ||
| 969 | 969 | |
| 970 | 970 | let obj = response.result; |
| 971 | 971 | if (obj.error) { |
| 972 | 972 | manageBackupsError = true; |
| 973 | - appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + __('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 973 | + appendToDiv(backtaskContentEl, '<span class="mainwp-red">[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) failed:', obj.title, obj.type) + ' ' + obj.error + '</span>'); | |
| 974 | 974 | } else { |
| 975 | - appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + __('Upload to %1 (%2) successful', obj.title, obj.type)); | |
| 975 | + appendToDiv(backtaskContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Upload to %1 (%2) successful', obj.title, obj.type)); | |
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | managebackups_backup_upload_file(pSiteId, pSiteName, pFile, pRegexFile, pSubfolder, pNewRemoteDestinations, pType, pSize); |
| 979 | 979 | } |
| @@ -1015,9 +1015,9 @@ | ||
| 1015 | 1015 | managebackups_init(); |
| 1016 | 1016 | |
| 1017 | 1017 | let errors = []; |
| 1018 | 1018 | if (jQuery('#mainwp_managebackups_add_name').val() == '') { |
| 1019 | - errors.push(__('Please enter a valid name for your backup task')); | |
| 1019 | + errors.push(MainWP.I18n.t('Please enter a valid name for your backup task')); | |
| 1020 | 1020 | } |
| 1021 | 1021 | let selected_groups = []; |
| 1022 | 1022 | let selected_sites = []; |
| 1023 | 1023 | if (jQuery('input[name="select_by"]').val() == 'site') { |
| @@ -1024,9 +1024,9 @@ | ||
| 1024 | 1024 | jQuery("input[name='selected_sites[]']:checked").each(function () { |
| 1025 | 1025 | selected_sites.push(jQuery(this).val()); |
| 1026 | 1026 | }); |
| 1027 | 1027 | if (selected_sites.length == 0) { |
| 1028 | - errors.push(__('Please select websites or groups to add a backup task.')); | |
| 1028 | + errors.push(MainWP.I18n.t('Please select websites or groups to add a backup task.')); | |
| 1029 | 1029 | } |
| 1030 | 1030 | } else { |
| 1031 | 1031 | jQuery("input[name='selected_groups[]']:checked").each(function () { |
| 1032 | 1032 | selected_groups.push(jQuery(this).val()); |
| @@ -1031,9 +1031,9 @@ | ||
| 1031 | 1031 | jQuery("input[name='selected_groups[]']:checked").each(function () { |
| 1032 | 1032 | selected_groups.push(jQuery(this).val()); |
| 1033 | 1033 | }); |
| 1034 | 1034 | if (selected_groups.length == 0) { |
| 1035 | - errors.push(__('Please select websites or groups to add a backup task.')); | |
| 1035 | + errors.push(MainWP.I18n.t('Please select websites or groups to add a backup task.')); | |
| 1036 | 1036 | } |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | if (errors.length > 0) { |
| @@ -1038,9 +1038,9 @@ | ||
| 1038 | 1038 | |
| 1039 | 1039 | if (errors.length > 0) { |
| 1040 | 1040 | feedback('mainwp-message-zone', errors.join('<br />'), 'red'); |
| 1041 | 1041 | } else { |
| 1042 | - feedback('mainwp-message-zone', __('Adding the task...'), 'green'); | |
| 1042 | + feedback('mainwp-message-zone', MainWP.I18n.t('Adding the task...'), 'green'); | |
| 1043 | 1043 | |
| 1044 | 1044 | jQuery('#mainwp_managebackups_update').attr('disabled', 'true'); //disable button to add.. |
| 1045 | 1045 | |
| 1046 | 1046 | //let loadFilesBeforeZip = jQuery( '[name="mainwp_options_loadFilesBeforeZip"]:checked' ).val(); |
| @@ -1084,9 +1084,9 @@ | ||
| 1084 | 1084 | managebackups_init(); |
| 1085 | 1085 | |
| 1086 | 1086 | let errors = []; |
| 1087 | 1087 | if (jQuery('#mainwp_managebackups_add_name').val() == '') { |
| 1088 | - errors.push(__('Please enter a valid name for your backup task')); | |
| 1088 | + errors.push(MainWP.I18n.t('Please enter a valid name for your backup task')); | |
| 1089 | 1089 | } |
| 1090 | 1090 | let selected_sites = []; |
| 1091 | 1091 | let selected_groups = []; |
| 1092 | 1092 | if (jQuery('input[name="select_by"]').val() == 'site') { |
| @@ -1093,9 +1093,9 @@ | ||
| 1093 | 1093 | jQuery("input[name='selected_sites[]']:checked").each(function () { |
| 1094 | 1094 | selected_sites.push(jQuery(this).val()); |
| 1095 | 1095 | }); |
| 1096 | 1096 | if (selected_sites.length == 0) { |
| 1097 | - errors.push(__('Please select websites or groups.')); | |
| 1097 | + errors.push(MainWP.I18n.t('Please select websites or groups.')); | |
| 1098 | 1098 | } |
| 1099 | 1099 | } else { |
| 1100 | 1100 | jQuery("input[name='selected_groups[]']:checked").each(function () { |
| 1101 | 1101 | selected_groups.push(jQuery(this).val()); |
| @@ -1100,9 +1100,9 @@ | ||
| 1100 | 1100 | jQuery("input[name='selected_groups[]']:checked").each(function () { |
| 1101 | 1101 | selected_groups.push(jQuery(this).val()); |
| 1102 | 1102 | }); |
| 1103 | 1103 | if (selected_groups.length == 0) { |
| 1104 | - errors.push(__('Please select websites or groups.')); | |
| 1104 | + errors.push(MainWP.I18n.t('Please select websites or groups.')); | |
| 1105 | 1105 | } |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | 1108 | |
| @@ -1108,9 +1108,9 @@ | ||
| 1108 | 1108 | |
| 1109 | 1109 | if (errors.length > 0) { |
| 1110 | 1110 | feedback('mainwp-message-zone', errors.join('<br />'), 'red'); |
| 1111 | 1111 | } else { |
| 1112 | - feedback('mainwp-message-zone', __('Adding the task...'), 'green'); | |
| 1112 | + feedback('mainwp-message-zone', MainWP.I18n.t('Adding the task...'), 'green'); | |
| 1113 | 1113 | |
| 1114 | 1114 | jQuery('#mainwp_managebackups_add').attr('disabled', 'true'); //disable button to add.. |
| 1115 | 1115 | |
| 1116 | 1116 | jQuery('#mainwp_managesites_add').attr('disabled', 'true'); //Disable add button |
| @@ -1153,11 +1153,11 @@ | ||
| 1153 | 1153 | managebackups_remove = function (element) { |
| 1154 | 1154 | let id = jQuery(element).attr('task_id'); |
| 1155 | 1155 | managebackups_init(); |
| 1156 | 1156 | |
| 1157 | - let msg = __('Are you sure you want to delete this backup task?'); | |
| 1157 | + let msg = MainWP.I18n.t('Are you sure you want to delete this backup task?'); | |
| 1158 | 1158 | mainwp_confirm(msg, function () { |
| 1159 | - jQuery('#task-status-' + id).html(__('Removing the task...')); | |
| 1159 | + jQuery('#task-status-' + id).html(MainWP.I18n.t('Removing the task...')); | |
| 1160 | 1160 | let data = mainwp_secure_data({ |
| 1161 | 1161 | action: 'mainwp_removebackup', |
| 1162 | 1162 | id: id |
| 1163 | 1163 | }); |
| @@ -1168,11 +1168,11 @@ | ||
| 1168 | 1168 | let error = ''; |
| 1169 | 1169 | if (response.error != undefined) { |
| 1170 | 1170 | error = response.error; |
| 1171 | 1171 | } else if (response.result == 'SUCCESS') { |
| 1172 | - result = __('The task has been removed.'); | |
| 1172 | + result = MainWP.I18n.t('The task has been removed.'); | |
| 1173 | 1173 | } else { |
| 1174 | - error = __('An undefined error occured.'); | |
| 1174 | + error = MainWP.I18n.t('An undefined error occurred.'); | |
| 1175 | 1175 | } |
| 1176 | 1176 | |
| 1177 | 1177 | if (error != '') { |
| 1178 | 1178 | setHtml('#mainwp_managebackups', error); |
| @@ -1192,9 +1192,9 @@ | ||
| 1192 | 1192 | managebackups_resume = function (element) { |
| 1193 | 1193 | let id = jQuery(element).attr('task_id'); |
| 1194 | 1194 | managebackups_init(); |
| 1195 | 1195 | |
| 1196 | - jQuery('#task-status-' + id).html(__('Resuming the task...')); | |
| 1196 | + jQuery('#task-status-' + id).html(MainWP.I18n.t('Resuming the task...')); | |
| 1197 | 1197 | let data = mainwp_secure_data({ |
| 1198 | 1198 | action: 'mainwp_resumebackup', |
| 1199 | 1199 | id: id |
| 1200 | 1200 | }); |
| @@ -1205,11 +1205,11 @@ | ||
| 1205 | 1205 | let error = ''; |
| 1206 | 1206 | if (response.error != undefined) { |
| 1207 | 1207 | error = response.error; |
| 1208 | 1208 | } else if (response.result == 'SUCCESS') { |
| 1209 | - result = __('The task has been resumed.'); | |
| 1209 | + result = MainWP.I18n.t('The task has been resumed.'); | |
| 1210 | 1210 | } else { |
| 1211 | - error = __('An undefined error occured.'); | |
| 1211 | + error = MainWP.I18n.t('An undefined error occurred.'); | |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | if (error != '') { |
| 1215 | 1215 | setHtml('#mainwp_managebackups', error); |
| @@ -1219,9 +1219,9 @@ | ||
| 1219 | 1219 | } |
| 1220 | 1220 | jQuery('#task-status-' + id).html(''); |
| 1221 | 1221 | |
| 1222 | 1222 | if (error == '') { |
| 1223 | - jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_pause(this)">' + __('Pause') + '</a>'); | |
| 1223 | + jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_pause(this)">' + MainWP.I18n.t('Pause') + '</a>'); | |
| 1224 | 1224 | jQuery(pElement).remove(); |
| 1225 | 1225 | } |
| 1226 | 1226 | } |
| 1227 | 1227 | }(element, id), 'json'); |
| @@ -1231,9 +1231,9 @@ | ||
| 1231 | 1231 | managebackups_pause = function (element) { |
| 1232 | 1232 | let id = jQuery(element).attr('task_id'); |
| 1233 | 1233 | managebackups_init(); |
| 1234 | 1234 | |
| 1235 | - jQuery('#task-status-' + id).html(__('Pausing the task...')); | |
| 1235 | + jQuery('#task-status-' + id).html(MainWP.I18n.t('Pausing the task...')); | |
| 1236 | 1236 | let data = mainwp_secure_data({ |
| 1237 | 1237 | action: 'mainwp_pausebackup', |
| 1238 | 1238 | id: id |
| 1239 | 1239 | }); |
| @@ -1244,11 +1244,11 @@ | ||
| 1244 | 1244 | let error = ''; |
| 1245 | 1245 | if (response.error != undefined) { |
| 1246 | 1246 | error = response.error; |
| 1247 | 1247 | } else if (response.result == 'SUCCESS') { |
| 1248 | - result = __('The task has been paused.'); | |
| 1248 | + result = MainWP.I18n.t('The task has been paused.'); | |
| 1249 | 1249 | } else { |
| 1250 | - error = __('An undefined error occured.'); | |
| 1250 | + error = MainWP.I18n.t('An undefined error occurred.'); | |
| 1251 | 1251 | } |
| 1252 | 1252 | |
| 1253 | 1253 | if (error != '') { |
| 1254 | 1254 | setHtml('#mainwp_managebackups', error); |
| @@ -1257,9 +1257,9 @@ | ||
| 1257 | 1257 | setHtml('#mainwp_managebackups_add_message', result); |
| 1258 | 1258 | } |
| 1259 | 1259 | jQuery('#task-status-' + id).html(''); |
| 1260 | 1260 | if (error == '') { |
| 1261 | - jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_resume(this)">' + __('Resume') + '</a>'); | |
| 1261 | + jQuery(pElement).after('<a href="#" task_id="' + pId + '" onClick="return managebackups_resume(this)">' + MainWP.I18n.t('Resume') + '</a>'); | |
| 1262 | 1262 | jQuery(pElement).remove(); |
| 1263 | 1263 | } |
| 1264 | 1264 | } |
| 1265 | 1265 | }(element, id), 'json'); |
| @@ -1287,15 +1287,15 @@ | ||
| 1287 | 1287 | } |
| 1288 | 1288 | |
| 1289 | 1289 | updatesoverviewShowBusyFunction = function () { |
| 1290 | 1290 | |
| 1291 | - let output = __('Checking if a backup is required for the selected updates...'); | |
| 1291 | + let output = MainWP.I18n.t('Checking if a backup is required for the selected updates...'); | |
| 1292 | 1292 | mainwpPopup('#updatesoverview-backup-box').getContentEl().html(output); |
| 1293 | 1293 | jQuery('#updatesoverview-backup-all').hide(); |
| 1294 | 1294 | jQuery('#updatesoverview-backup-ignore').hide(); |
| 1295 | 1295 | |
| 1296 | 1296 | mainwpPopup('#updatesoverview-backup-box').init({ |
| 1297 | - title: __("Checking backup settings..."), callback: function () { | |
| 1297 | + title: MainWP.I18n.t("Checking backup settings..."), callback: function () { | |
| 1298 | 1298 | window.location.href = location.href |
| 1299 | 1299 | } |
| 1300 | 1300 | }); |
| 1301 | 1301 | }; |
| @@ -1341,12 +1341,12 @@ | ||
| 1341 | 1341 | jQuery('#updatesoverview-backup-ignore').show(); |
| 1342 | 1342 | } else { |
| 1343 | 1343 | let backupLink = mainwp_get_primaryBackup_link(backupPrimary); |
| 1344 | 1344 | jQuery('#updatesoverview-backup-now').attr('href', backupLink).show(); |
| 1345 | - jQuery('#updatesoverview-backup-ignore').val(__('Proceed with Updates')).show(); | |
| 1345 | + jQuery('#updatesoverview-backup-ignore').val(MainWP.I18n.t('Proceed with Updates')).show(); | |
| 1346 | 1346 | } |
| 1347 | 1347 | |
| 1348 | - let output = '<span class="mainwp-red">' + __('A full backup has not been taken in the last days for the following sites:') + '</span><br /><br />'; | |
| 1348 | + let output = '<span class="mainwp-red">' + MainWP.I18n.t('A full backup has not been taken in the last days for the following sites:') + '</span><br /><br />'; | |
| 1349 | 1349 | |
| 1350 | 1350 | if (backupPrimary == '') { // default backup feature |
| 1351 | 1351 | for (let id of siteFeedback) { |
| 1352 | 1352 | output += '<span class="updatesoverview-backup-site" siteid="' + id + '">' + decodeURIComponent(pSiteNames[id]) + '</span><br />'; |
| @@ -1359,9 +1359,9 @@ | ||
| 1359 | 1359 | |
| 1360 | 1360 | mainwpPopup('#updatesoverview-backup-box').getContentEl().html(output); |
| 1361 | 1361 | |
| 1362 | 1362 | mainwpPopup('#updatesoverview-backup-box').init({ |
| 1363 | - title: __("Full backup required!"), callback: function () { | |
| 1363 | + title: MainWP.I18n.t("Full backup required!"), callback: function () { | |
| 1364 | 1364 | if (updatesoverviewContinueAfterBackup != undefined) { |
| 1365 | 1365 | updatesoverviewContinueAfterBackup = undefined; |
| 1366 | 1366 | } |
| 1367 | 1367 | window.location.href = location.href |
| @@ -1400,11 +1400,11 @@ | ||
| 1400 | 1400 | }); |
| 1401 | 1401 | jQuery(document).on('click', '#updatesoverview-backup-all', function () { |
| 1402 | 1402 | |
| 1403 | 1403 | // change action buttons |
| 1404 | - mainwpPopup('#updatesoverview-backup-box').setActionButtons('<input id="updatesoverview-backupnow-close" type="button" name="Ignore" value="' + __('Cancel') + '" class="button"/>'); | |
| 1404 | + mainwpPopup('#updatesoverview-backup-box').setActionButtons('<input id="updatesoverview-backupnow-close" type="button" name="Ignore" value="' + MainWP.I18n.t('Cancel') + '" class="button"/>'); | |
| 1405 | 1405 | mainwpPopup('#updatesoverview-backup-box').init({ |
| 1406 | - title: __("Full backup"), callback: function () { | |
| 1406 | + title: MainWP.I18n.t("Full backup"), callback: function () { | |
| 1407 | 1407 | updatesoverviewContinueAfterBackup = undefined; |
| 1408 | 1408 | window.location.href = location.href |
| 1409 | 1409 | } |
| 1410 | 1410 | }); |
| @@ -1424,10 +1424,10 @@ | ||
| 1424 | 1424 | let updatesoverviewBackupError; |
| 1425 | 1425 | let updatesoverviewBackupDownloadRunning; |
| 1426 | 1426 | |
| 1427 | 1427 | updatesoverview_backup_run = function () { |
| 1428 | - mainwpPopup('#updatesoverview-backup-box').getContentEl().html(dateToHMS(new Date()) + ' ' + __('Starting required backup(s)...')); | |
| 1429 | - jQuery('#updatesoverview-backupnow-close').prop('value', __('Cancel')); | |
| 1428 | + mainwpPopup('#updatesoverview-backup-box').getContentEl().html(dateToHMS(new Date()) + ' ' + MainWP.I18n.t('Starting required backup(s)...')); | |
| 1429 | + jQuery('#updatesoverview-backupnow-close').prop('value', MainWP.I18n.t('Cancel')); | |
| 1430 | 1430 | jQuery('#updatesoverview-backupnow-close').prop('cancel', '1'); |
| 1431 | 1431 | updatesoverview_backup_run_next(); |
| 1432 | 1432 | }; |
| 1433 | 1433 | |
| @@ -1433,21 +1433,21 @@ | ||
| 1433 | 1433 | |
| 1434 | 1434 | updatesoverview_backup_run_next = function () { |
| 1435 | 1435 | let backupContentEl = mainwpPopup('#updatesoverview-backup-box').getContentEl(); |
| 1436 | 1436 | if (updatesoverviewBackupSites.length == 0) { |
| 1437 | - appendToDiv(backupContentEl, __('Required backup(s) completed') + (updatesoverviewBackupError ? ' <span class="mainwp-red">' + __('with errors') + '</span>' : '') + '.'); | |
| 1437 | + appendToDiv(backupContentEl, MainWP.I18n.t('Required backup(s) completed') + (updatesoverviewBackupError ? ' <span class="mainwp-red">' + MainWP.I18n.t('with errors') + '</span>' : '') + '.'); | |
| 1438 | 1438 | |
| 1439 | 1439 | jQuery('#updatesoverview-backupnow-close').prop('cancel', '0'); |
| 1440 | 1440 | if (updatesoverviewBackupError) { |
| 1441 | - jQuery('#updatesoverview-backupnow-close').prop('value', __('Continue update anyway')); | |
| 1441 | + jQuery('#updatesoverview-backupnow-close').prop('value', MainWP.I18n.t('Continue update anyway')); | |
| 1442 | 1442 | } else { |
| 1443 | - jQuery('#updatesoverview-backupnow-close').prop('value', __('Continue update')); | |
| 1443 | + jQuery('#updatesoverview-backupnow-close').prop('value', MainWP.I18n.t('Continue update')); | |
| 1444 | 1444 | } |
| 1445 | 1445 | return; |
| 1446 | 1446 | } |
| 1447 | 1447 | |
| 1448 | 1448 | let siteName = updatesoverviewBackupSites[0]['name']; |
| 1449 | - appendToDiv(backupContentEl, '[' + siteName + '] ' + __('Creating backup file...')); | |
| 1449 | + appendToDiv(backupContentEl, '[' + siteName + '] ' + MainWP.I18n.t('Creating backup file...')); | |
| 1450 | 1450 | |
| 1451 | 1451 | let siteId = updatesoverviewBackupSites[0]['id']; |
| 1452 | 1452 | updatesoverviewBackupSites.shift(); |
| 1453 | 1453 | let data = mainwp_secure_data({ |
| @@ -1461,9 +1461,9 @@ | ||
| 1461 | 1461 | appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>'); |
| 1462 | 1462 | updatesoverviewBackupError = true; |
| 1463 | 1463 | updatesoverview_backup_run_next(); |
| 1464 | 1464 | } else { |
| 1465 | - appendToDiv(backupContentEl, '[' + pSiteName + '] ' + __('Backup file created successfully!')); | |
| 1465 | + appendToDiv(backupContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup file created successfully!')); | |
| 1466 | 1466 | |
| 1467 | 1467 | updatesoverview_backupnow_download_file(pSiteId, pSiteName, response.result.type, response.result.url, response.result.local, response.result.regexfile, response.result.size, response.result.subfolder); |
| 1468 | 1468 | } |
| 1469 | 1469 | |
| @@ -1508,9 +1508,9 @@ | ||
| 1508 | 1508 | clearInterval(pInterVal); |
| 1509 | 1509 | |
| 1510 | 1510 | if (response.error) { |
| 1511 | 1511 | appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">ERROR: ' + getErrorMessage(response.error) + '</span>'); |
| 1512 | - appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + __('Backup failed!') + '</span>'); | |
| 1512 | + appendToDiv(backupContentEl, '[' + pSiteName + '] <span class="mainwp-red">' + MainWP.I18n.t('Backup failed!') + '</span>'); | |
| 1513 | 1513 | |
| 1514 | 1514 | updatesoverviewBackupError = true; |
| 1515 | 1515 | updatesoverview_backup_run_next(); |
| 1516 | 1516 | return; |
| @@ -1516,10 +1516,10 @@ | ||
| 1516 | 1516 | return; |
| 1517 | 1517 | } |
| 1518 | 1518 | |
| 1519 | 1519 | jQuery('#updatesoverview-backupnow-status-progress[siteId="' + pSiteId + '"]').progress('set progress', pSize); |
| 1520 | - appendToDiv(backupContentEl, '[' + pSiteName + '] ' + __('Download from the child site completed.')); | |
| 1521 | - appendToDiv(backupContentEl, '[' + pSiteName + '] ' + __('Backup completed.')); | |
| 1520 | + appendToDiv(backupContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Download from the child site completed.')); | |
| 1521 | + appendToDiv(backupContentEl, '[' + pSiteName + '] ' + MainWP.I18n.t('Backup completed.')); | |
| 1522 | 1522 | |
| 1523 | 1523 | let newData = mainwp_secure_data({ |
| 1524 | 1524 | action: 'mainwp_backup_delete_file', |
| 1525 | 1525 | site_id: pSiteId, |