diff --git a/src/js/controllers/copayers.js b/src/js/controllers/copayers.js index 2e2b6296b..51a7e2845 100644 --- a/src/js/controllers/copayers.js +++ b/src/js/controllers/copayers.js @@ -4,6 +4,10 @@ angular.module('copayApp.controllers').controller('copayersController', function($scope, $rootScope, $timeout, $log, $modal, profileService, go, notification, isCordova, gettext, gettextCatalog) { var self = this; + var delete_msg = gettextCatalog.getString('Are you sure you want to delete this wallet?'); + var ok_msg = gettextCatalog.getString('OK'); + var cancel_msg = gettextCatalog.getString('Cancel'); + var confirm_msg = gettextCatalog.getString('Confirm'); self.init = function() { var fc = profileService.focusedClient; @@ -18,16 +22,16 @@ angular.module('copayApp.controllers').controller('copayersController', var _modalDeleteWallet = function() { var ModalInstanceCtrl = function($scope, $modalInstance, gettext) { - $scope.title = gettext('Are you sure you want to delete this wallet?'); + $scope.title = delete_msg; $scope.loading = false; $scope.ok = function() { $scope.loading = true; - $modalInstance.close('ok'); + $modalInstance.close(ok_msg); }; $scope.cancel = function() { - $modalInstance.dismiss('cancel'); + $modalInstance.dismiss(cancel_msg); }; }; @@ -59,7 +63,7 @@ angular.module('copayApp.controllers').controller('copayersController', } else { go.walletHome(); $timeout(function() { - notification.success(gettext('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName})); + notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName})); }); } }); @@ -70,13 +74,13 @@ angular.module('copayApp.controllers').controller('copayersController', var fc = profileService.focusedClient; if (isCordova) { navigator.notification.confirm( - 'Are you sure you want to delete this wallet?', + delete_msg, function(buttonIndex) { if (buttonIndex == 2) { _deleteWallet(); } }, - 'Confirm', ['Cancel', 'OK'] + confirm_msg, [cancel_msg, ok_msg] ); } else { _modalDeleteWallet(); @@ -86,7 +90,7 @@ angular.module('copayApp.controllers').controller('copayersController', self.copySecret = function(secret) { if (isCordova) { window.cordova.plugins.clipboard.copy(secret); - window.plugins.toast.showShortCenter('Copied to clipboard'); + window.plugins.toast.showShortCenter(gettextCatalog.getString('Copied to clipboard')); } }; @@ -95,9 +99,9 @@ angular.module('copayApp.controllers').controller('copayersController', if (isMobile.Android() || isMobile.Windows()) { window.ignoreMobilePause = true; } - var message = 'Join my Copay wallet. Here is the invitation code: ' + secret + ' You can download Copay for your phone or desktop at https://copay.io'; - window.plugins.socialsharing.share(message, 'Invitation to share a Copay Wallet', null, null); + var message = gettextCatalog.getString('Join my Copay wallet. Here is the invitation code: {{secret}} You can download Copay for your phone or desktop at https://copay.io', {secret: secret}); + window.plugins.socialsharing.share(message, gettextCatalog.getString('Invitation to share a Copay Wallet'), null, null); } }; - }); + }); \ No newline at end of file diff --git a/src/js/controllers/preferencesDelete.js b/src/js/controllers/preferencesDelete.js index 67176147a..9cdb905e5 100644 --- a/src/js/controllers/preferencesDelete.js +++ b/src/js/controllers/preferencesDelete.js @@ -5,18 +5,23 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro this.isCordova = isCordova; this.error = null; + var delete_msg = gettextCatalog.getString('Are you sure you want to delete this wallet?'); + var ok_msg = gettextCatalog.getString('OK'); + var cancel_msg = gettextCatalog.getString('Cancel'); + var confirm_msg = gettextCatalog.getString('Confirm'); + var _modalDeleteWallet = function() { var ModalInstanceCtrl = function($scope, $modalInstance, gettext) { - $scope.title = gettext('Are you sure you want to delete this wallet?'); + $scope.title = delete_msg; $scope.loading = false; $scope.ok = function() { $scope.loading = true; - $modalInstance.close('ok'); + $modalInstance.close(ok_msg); }; $scope.cancel = function() { - $modalInstance.dismiss('cancel'); + $modalInstance.dismiss(cancel_msg); }; }; @@ -42,7 +47,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro if (err) { self.error = err.message || err; } else { - notification.success(gettext('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName})); + notification.success(gettextCatalog.getString('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName})); } }); }; @@ -50,16 +55,16 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro this.deleteWallet = function() { if (isCordova) { navigator.notification.confirm( - 'Are you sure you want to delete this wallet?', + delete_msg, function(buttonIndex) { if (buttonIndex == 2) { _deleteWallet(); } }, - 'Confirm', ['Cancel', 'OK'] + confirm_msg, [cancel_msg, ok_msg] ); } else { _modalDeleteWallet(); } }; - }); + }); \ No newline at end of file