added translation attribute to controllers files.

This commit is contained in:
Gustavo Maximiliano Cortez 2014-09-16 17:30:30 -03:00
commit 4a91729121
8 changed files with 327 additions and 37 deletions

View file

@ -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() {

View file

@ -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) {

View file

@ -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() {

View file

@ -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';