added translation attribute to controllers files.
This commit is contained in:
parent
205cd39599
commit
4a91729121
8 changed files with 327 additions and 37 deletions
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('MoreController',
|
||||
function($scope, $rootScope, $location, backupService, walletFactory, controllerUtils, notification, rateService) {
|
||||
function($scope, $rootScope, $location, $filter, backupService, walletFactory, controllerUtils, notification, rateService) {
|
||||
var w = $rootScope.wallet;
|
||||
|
||||
$scope.unitOpts = [{
|
||||
|
|
@ -80,7 +80,7 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
if (removed) {
|
||||
controllerUtils.updateBalance();
|
||||
}
|
||||
notification.info('Transactions Proposals Purged', removed + ' transaction proposal purged');
|
||||
notification.info('Transactions Proposals Purged', removed + ' ' + $filter('translate')('transaction proposal purged'));
|
||||
};
|
||||
|
||||
$scope.updateIndexes = function() {
|
||||
|
|
@ -88,7 +88,7 @@ angular.module('copayApp.controllers').controller('MoreController',
|
|||
w.updateIndexes(function(err) {
|
||||
notification.info('Scan Ended', 'Updating balance');
|
||||
if (err) {
|
||||
notification.error('Error', 'Error updating indexes: ' + err);
|
||||
notification.error('Error', $filter('translate')('Error updating indexes: ') + err);
|
||||
}
|
||||
controllerUtils.updateAddressList();
|
||||
controllerUtils.updateBalance(function() {
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
|
||||
$scope.submitForm = function(form) {
|
||||
if (form.$invalid) {
|
||||
var message = 'Unable to send transaction proposal.';
|
||||
var message = 'Unable to send transaction proposal';
|
||||
notification.error('Error', message);
|
||||
return;
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
message += ' Message from server: ' + merchantData.ack.memo;
|
||||
message += ' For merchant: ' + merchantData.pr.pd.payment_url;
|
||||
}
|
||||
notification.success('Success!', message);
|
||||
notification.success('Success', message);
|
||||
$scope.loadTxs();
|
||||
} else {
|
||||
w.sendTx(ntxid, function(txid, merchantData) {
|
||||
|
|
@ -165,9 +165,9 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
message += ' Message from server: ' + merchantData.ack.memo;
|
||||
message += ' For merchant: ' + merchantData.pr.pd.payment_url;
|
||||
}
|
||||
notification.success('Transaction broadcast', message);
|
||||
notification.success('Transaction broadcasted', message);
|
||||
} else {
|
||||
notification.error('Error', 'There was an error sending the transaction.');
|
||||
notification.error('Error', 'There was an error sending the transaction');
|
||||
}
|
||||
$scope.loading = false;
|
||||
$scope.loadTxs();
|
||||
|
|
@ -421,7 +421,7 @@ angular.module('copayApp.controllers').controller('SendController',
|
|||
notification.error('Error', 'There was an error sending the transaction');
|
||||
} else {
|
||||
if (!merchantData) {
|
||||
notification.success('Transaction broadcast', 'Transaction id: ' + txid);
|
||||
notification.success('Transaction broadcasted', 'Transaction id: ' + txid);
|
||||
} else {
|
||||
var message = 'Transaction ID: ' + txid;
|
||||
if (merchantData.pr.ca) {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $sce, $location, $http, notification, controllerUtils) {
|
||||
angular.module('copayApp.controllers').controller('SidebarController', function($scope, $rootScope, $sce, $location, $http, $filter, notification, controllerUtils) {
|
||||
|
||||
$scope.menu = [{
|
||||
'title': 'Receive',
|
||||
|
|
@ -60,7 +60,7 @@ angular.module('copayApp.controllers').controller('SidebarController', function(
|
|||
if ($rootScope.wallet) {
|
||||
$scope.$on('$idleWarn', function(a,countdown) {
|
||||
if (!(countdown%5))
|
||||
notification.warning('Session will be closed', 'Your session is about to expire due to inactivity in ' + countdown + ' seconds');
|
||||
notification.warning('Session will be closed', $filter('translate')('Your session is about to expire due to inactivity in') + ' ' + countdown + ' ' + $filter('translate')('seconds'));
|
||||
});
|
||||
|
||||
$scope.$on('$idleTimeout', function() {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('VersionController',
|
||||
function($scope, $rootScope, $http, notification) {
|
||||
function($scope, $rootScope, $http, $filter, notification) {
|
||||
|
||||
var w = $rootScope.wallet;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ angular.module('copayApp.controllers').controller('VersionController',
|
|||
};
|
||||
var latestVersion = data[0].name.replace('v', '').split('.').map(toInt);
|
||||
var currentVersion = copay.version.split('.').map(toInt);
|
||||
var title = 'Copay ' + data[0].name + ' available.';
|
||||
var title = 'Copay ' + data[0].name + $filter('translate')(' available.');
|
||||
var content;
|
||||
if (currentVersion[0] < latestVersion[0]) {
|
||||
content = 'It\'s important that you update your wallet at https://copay.io';
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ BackupService.prototype.download = function(wallet) {
|
|||
var copayerName = this.getCopayer(wallet);
|
||||
var filename = (copayerName ? copayerName + '-' : '') + walletName + '-keybackup.json.aes';
|
||||
|
||||
this.notifications.success('Backup created', 'Encrypted backup file saved.');
|
||||
this.notifications.success('Backup created', 'Encrypted backup file saved');
|
||||
var blob = new Blob([ew], {
|
||||
type: 'text/plain;charset=utf-8'
|
||||
});
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
var bitcore = require('bitcore');
|
||||
|
||||
angular.module('copayApp.services')
|
||||
.factory('controllerUtils', function($rootScope, $sce, $location, notification, $timeout, uriHandler, rateService) {
|
||||
.factory('controllerUtils', function($rootScope, $sce, $location, $filter, notification, $timeout, uriHandler, rateService) {
|
||||
var root = {};
|
||||
|
||||
root.redirIfLogged = function() {
|
||||
|
|
@ -51,7 +51,7 @@ angular.module('copayApp.services')
|
|||
});
|
||||
|
||||
w.on('corrupt', function(peerId) {
|
||||
notification.error('Error', 'Received corrupt message from ' + peerId);
|
||||
notification.error('Error', $filter('translate')('Received corrupt message from ') + peerId);
|
||||
});
|
||||
w.on('ready', function(myPeerID) {
|
||||
$rootScope.wallet = w;
|
||||
|
|
@ -111,13 +111,13 @@ angular.module('copayApp.services')
|
|||
var user = w.publicKeyRing.nicknameForCopayer(e.cId);
|
||||
switch (e.type) {
|
||||
case 'signed':
|
||||
notification.info('Transaction Update', 'A transaction was signed by ' + user);
|
||||
notification.info('Transaction Update', $filter('translate')('A transaction was signed by') + ' ' + user);
|
||||
break;
|
||||
case 'rejected':
|
||||
notification.info('Transaction Update', 'A transaction was rejected by ' + user);
|
||||
notification.info('Transaction Update', $filter('translate')('A transaction was rejected by') + ' ' + user);
|
||||
break;
|
||||
case 'corrupt':
|
||||
notification.error('Transaction Error', 'Received corrupt transaction from ' + user);
|
||||
notification.error('Transaction Error', $filter('translate')('Received corrupt transaction from') + ' ' + user);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
|
@ -142,7 +142,7 @@ angular.module('copayApp.services')
|
|||
$rootScope.$watch('txAlertCount', function(txAlertCount) {
|
||||
if (txAlertCount && txAlertCount > 0) {
|
||||
|
||||
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ? 'You have a pending transaction proposal' : 'You have ' + $rootScope.txAlertCount + ' pending transaction proposals', txAlertCount);
|
||||
notification.info('New Transaction', ($rootScope.txAlertCount == 1) ? 'You have a pending transaction proposal' : $filter('translate')('You have') + ' ' + $rootScope.txAlertCount + ' ' + $filter('translate')('pending transaction proposals'), txAlertCount);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue