Update translations for controllers and services

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-29 19:19:10 -03:00
commit cbf3d7cceb
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
22 changed files with 564 additions and 195 deletions

View file

@ -2,7 +2,7 @@
'use strict';
angular.module('copayApp.controllers').controller('backupController',
function($rootScope, $scope, $timeout, backupService, profileService, isMobile, isCordova, notification, go) {
function($rootScope, $scope, $timeout, backupService, profileService, isMobile, isCordova, notification, go, gettext) {
this.isSafari = isMobile.Safari();
this.isCordova = isCordova;
this.error = null;
@ -14,7 +14,7 @@ angular.module('copayApp.controllers').controller('backupController',
this.downloadWalletBackup = function() {
backupService.walletDownload(this.password, function() {
$rootScope.$emit('Local/BackupDone');
notification.success('Backup created', 'Encrypted backup file saved');
notification.success(gettext('Backup created'), gettext('Encrypted backup file saved'));
go.walletHome();
});
};

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('copayersController',
function($scope, $rootScope, $timeout, $log, $modal, profileService, go, notification, isCordova) {
function($scope, $rootScope, $timeout, $log, $modal, profileService, go, notification, isCordova, gettext, gettextCatalog) {
var self = this;
@ -17,8 +17,8 @@ angular.module('copayApp.controllers').controller('copayersController',
};
var _modalDeleteWallet = function() {
var ModalInstanceCtrl = function($scope, $modalInstance) {
$scope.title = 'Are you sure you want to delete this wallet?';
var ModalInstanceCtrl = function($scope, $modalInstance, gettext) {
$scope.title = gettext('Are you sure you want to delete this wallet?');
$scope.loading = false;
$scope.ok = function() {
@ -59,7 +59,7 @@ angular.module('copayApp.controllers').controller('copayersController',
} else {
go.walletHome();
$timeout(function() {
notification.success('Success', 'The wallet "' + walletName + '" was deleted');
notification.success(gettext('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName}));
});
}
});

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('createController',
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isMobile, isCordova) {
function($scope, $rootScope, $location, $timeout, $log, lodash, go, profileService, configService, isMobile, isCordova, gettext) {
var self = this;
var defaults = configService.getDefaults();
@ -43,7 +43,7 @@ angular.module('copayApp.controllers').controller('createController',
this.create = function(form) {
if (form && form.$invalid) {
this.error = 'Please enter the required fields';
this.error = gettext('Please enter the required fields');
return;
}
var opts = {
@ -61,7 +61,7 @@ angular.module('copayApp.controllers').controller('createController',
self.loading = false;
if (err) {
$log.debug(err);
self.error = 'Could not create wallet: ' + err;
self.error = gettext('Could not create wallet: ') + err;
}
else {
go.walletHome();
@ -77,7 +77,7 @@ angular.module('copayApp.controllers').controller('createController',
this.hideWalletName = true;
}
else {
this.hideWalletName = false;
this.hideWalletName = false;
}
$timeout(function() {
$rootScope.$digest();

View file

@ -21,7 +21,7 @@ angular.module('copayApp.controllers').controller('importController',
try {
str2 = sjcl.decrypt(self.password, str);
} catch (e) {
self.error = 'Could not decrypt file, check your password';
self.error = gettext('Could not decrypt file, check your password');
$log.warn(e);
return;
};
@ -40,7 +40,7 @@ angular.module('copayApp.controllers').controller('importController',
else {
$rootScope.$emit('Local/WalletImported', walletId);
go.walletHome();
notification.success('Success', 'Your wallet has been imported correctly');
notification.success(gettext('Success'), gettext('Your wallet has been imported correctly'));
}
});
}, 100);
@ -57,7 +57,7 @@ angular.module('copayApp.controllers').controller('importController',
this.import = function(form) {
if (form.$invalid) {
this.error = 'There is an error in the form';
this.error = gettext('There is an error in the form');
$scope.$apply();
return;
}
@ -67,7 +67,7 @@ angular.module('copayApp.controllers').controller('importController',
var password = form.password.$modelValue;
if (!backupFile && !backupText) {
this.error = 'Please, select your backup file';
this.error = gettext('Please, select your backup file');
$scope.$apply();
return;
}

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('importLegacyController',
function($rootScope, $scope, $log, $timeout, notification, legacyImportService, profileService, go, lodash, bitcore) {
function($rootScope, $scope, $log, $timeout, notification, legacyImportService, profileService, go, lodash, bitcore, gettext, gettextCatalog) {
var self = this;
self.messages = [];
@ -50,11 +50,11 @@ angular.module('copayApp.controllers').controller('importLegacyController',
legacyImportService.import(username, password, serverURL, fromCloud, function(err, ids, toScanIds) {
if (err || !ids || !ids.length) {
self.importing = false;
self.error = err || 'Failed to import wallets';
self.error = err || gettext('Failed to import wallets');
return;
}
notification.success( ids.length + ' wallets imported. Funds scanning in progress. Hold on to see updated balance.');
notification.success( gettextCatalog.getString('{{len}} wallets imported. Funds scanning in progress. Hold on to see updated balance', {len: ids.length}));
self.scan(toScanIds);
});
}, 100);

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, rateService, storageService, gettextCatalog, amMoment) {
angular.module('copayApp.controllers').controller('indexController', function($rootScope, $scope, $log, $filter, $timeout, lodash, go, profileService, configService, isCordova, rateService, storageService, gettextCatalog, gettext, amMoment) {
var self = this;
self.isCordova = isCordova;
@ -12,19 +12,19 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
self.menu = [{
'title': 'Home',
'title': gettext('Home'),
'icon': 'icon-home',
'link': 'walletHome'
}, {
'title': 'Receive',
'title': gettext('Receive'),
'icon': 'icon-receive',
'link': 'receive'
}, {
'title': 'Send',
'title': gettext('Send'),
'icon': 'icon-paperplane',
'link': 'send'
}, {
'title': 'History',
'title': gettext('History'),
'icon': 'icon-history',
'link': 'history'
}];
@ -32,16 +32,16 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.tab = 'walletHome';
self.availableLanguages = [{
name: 'English',
name: gettext('English'),
isoCode: 'en',
}, {
name: 'Spanish',
name: gettext('Spanish'),
isoCode: 'es',
}, {
name: 'Français',
name: gettext('French'),
isoCode: 'fr',
}, {
name: '日本人',
name: gettext('Japanese'),
isoCode: 'ja',
}];

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('joinController',
function($scope, $rootScope, $timeout, go, isMobile, notification, profileService, isCordova, $modal) {
function($scope, $rootScope, $timeout, go, isMobile, notification, profileService, isCordova, $modal, gettext) {
var self = this;
@ -140,7 +140,7 @@ angular.module('copayApp.controllers').controller('joinController',
this.join = function(form) {
if (form && form.$invalid) {
self.error = 'Please enter the required fields';
self.error = gettext('Please enter the required fields');
return;
}
self.loading = true;
@ -153,7 +153,7 @@ angular.module('copayApp.controllers').controller('joinController',
}, function(err) {
if (err) {
self.loading = false;
self.error = 'Could not join wallet: ' + (err.message ? err.message : err);
self.error = gettext('Could not join wallet: ') + (err.message ? err.message : err);
$rootScope.$apply();
return
}

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('passwordController',
function($rootScope, $scope, $timeout, profileService, notification, go) {
function($rootScope, $scope, $timeout, profileService, notification, go, gettext) {
var self = this;
@ -27,7 +27,7 @@ angular.module('copayApp.controllers').controller('passwordController',
}
if (isSetup) {
if (pass1 != self.password) {
self.error = 'Passwords do not match';
self.error = gettext('Passwords do not match');
self.isVerification = false;
self.password = null;
pass1 =null;

View file

@ -1,13 +1,13 @@
'use strict';
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
function($scope, $rootScope, $filter, $timeout, $modal, notification, profileService, isCordova, go) {
function($scope, $rootScope, $filter, $timeout, $modal, notification, profileService, isCordova, go, gettext) {
this.isCordova = isCordova;
this.error = null;
var _modalDeleteWallet = function() {
var ModalInstanceCtrl = function($scope, $modalInstance) {
$scope.title = 'Are you sure you want to delete this wallet?';
var ModalInstanceCtrl = function($scope, $modalInstance, gettext) {
$scope.title = gettext('Are you sure you want to delete this wallet?');
$scope.loading = false;
$scope.ok = function() {
@ -47,7 +47,7 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
} else {
go.walletHome();
$timeout(function() {
notification.success('Success', 'The wallet "' + walletName + '" was deleted');
notification.success(gettext('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName}));
});
}
});

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp) {
angular.module('copayApp.controllers').controller('walletHomeController', function($scope, $rootScope, $timeout, $filter, $modal, $log, notification, txStatus, isCordova, profileService, lodash, configService, rateService, storageService, bitcore, isChromeApp, gettext, gettextCatalog) {
var self = this;
$rootScope.hideMenuBar = false;
@ -176,7 +176,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
return;
};
self.setOngoingProcess('Signing transaction');
self.setOngoingProcess(gettext('Signing transaction'));
$scope.loading = true;
$scope.error = null;
$timeout(function() {
@ -185,19 +185,19 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess();
if (err) {
$scope.loading = false;
$scope.error = err.message || 'Transaction not signed. Please try again.';
$scope.error = err.message || gettext('Transaction not signed. Please try again.');
$scope.$digest();
} else {
//if txp has required signatures then broadcast it
var txpHasRequiredSignatures = txpsi.status == 'accepted';
if (txpHasRequiredSignatures) {
self.setOngoingProcess('Broadcasting transaction');
self.setOngoingProcess(gettext('Broadcasting transaction'));
$scope.loading = true;
fc.broadcastTxProposal(txpsi, function(err, txpsb) {
self.setOngoingProcess();
$scope.loading = false;
if (err) {
$scope.error = 'Transaction not broadcasted. Please try again.';
$scope.error = gettext('Transaction not broadcasted. Please try again.');
$scope.$digest();
} else {
$modalInstance.close(txpsb);
@ -213,7 +213,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
};
$scope.reject = function(txp) {
self.setOngoingProcess('Rejecting transaction');
self.setOngoingProcess(gettext('Rejecting transaction'));
$scope.loading = true;
$scope.error = null;
$timeout(function() {
@ -221,7 +221,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess();
$scope.loading = false;
if (err) {
$scope.error = err.message || 'Transaction not rejected. Please try again.';
$scope.error = err.message || gettext('Transaction not rejected. Please try again.');
$scope.$digest();
} else {
$modalInstance.close(txpr);
@ -232,7 +232,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
$scope.remove = function(txp) {
self.setOngoingProcess('Deleting transaction');
self.setOngoingProcess(gettext('Deleting transaction'));
$scope.loading = true;
$scope.error = null;
$timeout(function() {
@ -242,7 +242,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
// Hacky: request tries to parse an empty response
if (err && !(err.message && err.message.match(/Unexpected/))) {
$scope.error = err.message || 'Transaction could not be deleted. Please try again.';
$scope.error = err.message || gettext('Transaction could not be deleted. Please try again.');
$scope.$digest();
return;
}
@ -252,7 +252,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
};
$scope.broadcast = function(txp) {
self.setOngoingProcess('Broadcasting transaction');
self.setOngoingProcess(gettext('Broadcasting transaction'));
$scope.loading = true;
$scope.error = null;
$timeout(function() {
@ -260,7 +260,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.setOngoingProcess();
$scope.loading = false;
if (err) {
$scope.error = err.message || 'Transaction not sent. Please try again.';
$scope.error = err.message || gettext('Transaction not sent. Please try again.');
$scope.$digest();
} else {
$modalInstance.close(txpb);
@ -515,7 +515,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
var form = $scope.sendForm;
if (form.$invalid) {
this.error = 'Unable to send transaction proposal';
this.error = gettext('Unable to send transaction proposal');
return;
}
@ -527,7 +527,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
return;
};
self.setOngoingProcess('Creating transaction');
self.setOngoingProcess(gettext('Creating transaction'));
$timeout(function() {
var comment = form.comment.$modelValue;
var paypro = self._paypro;
@ -563,7 +563,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.signAndBroadcast = function(txp, cb) {
var fc = profileService.focusedClient;
self.setOngoingProcess('Signing transaction');
self.setOngoingProcess(gettext('Signing transaction'));
fc.signTxProposal(txp, function(err, signedTx) {
profileService.lockFC();
@ -573,11 +573,11 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
}
if (signedTx.status == 'accepted') {
self.setOngoingProcess('Broadcasting transaction');
self.setOngoingProcess(gettext('Broadcasting transaction'));
fc.broadcastTxProposal(signedTx, function(err, btx) {
self.setOngoingProcess();
if (err) {
$scope.error = 'Transaction not broadcasted. Please try again.';
$scope.error = gettext('Transaction not broadcasted. Please try again.');
$scope.$digest();
return cb(err);
}
@ -677,13 +677,13 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
this.setFromPayPro = function(uri) {
var fc = profileService.focusedClient;
if (isChromeApp) {
this.error = 'Payment Protocol not supported on Chrome App';
this.error = gettext('Payment Protocol not supported on Chrome App');
return;
}
var satToUnit = 1 / this.unitToSatoshi;
var self = this;
self.setOngoingProcess('Fetching Payment Informantion');
self.setOngoingProcess(gettext('Fetching Payment Informantion'));
$log.debug('Fetch PayPro Request...', uri);
$timeout(function() {
@ -697,7 +697,7 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
self.resetForm();
var msg = err.toString();
if (msg.match('HTTP')) {
msg = 'Could not fetch payment information';
msg = gettext('Could not fetch payment information');
}
self.error = msg;
} else {

View file

@ -145,8 +145,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Join shared wallet';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Join shared wallet');
$scope.goBackToState = 'add';
$scope.noColor = true;
}
@ -162,8 +162,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Import wallet';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Import wallet');
$scope.goBackToState = 'add';
$scope.noColor = true;
}
@ -184,8 +184,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Import legacy wallet';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Import legacy wallet');
$scope.goBackToState = 'add';
$scope.noColor = true;
}
@ -203,8 +203,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Create new wallet';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Create new wallet');
$scope.goBackToState = 'add';
$scope.noColor = true;
}
@ -251,8 +251,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Language';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Language');
$scope.goBackToState = 'preferences';
$scope.noColor = true;
}
@ -270,8 +270,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Unit';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Unit');
$scope.goBackToState = 'preferences';
$scope.noColor = true;
}
@ -289,8 +289,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Color';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Color');
$scope.goBackToState = 'preferences';
}
}
@ -308,8 +308,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Alternative Currency';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Alternative Currency');
$scope.goBackToState = 'preferences';
$scope.noColor = true;
}
@ -346,8 +346,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Delete';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Delete');
$scope.goBackToState = 'preferences';
}
}
@ -364,8 +364,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'About';
controller: function($scope, gettext) {
$scope.titleSection = gettext('About');
$scope.goBackToState = 'preferences';
$scope.noColor = true;
}
@ -383,8 +383,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Logs';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Logs');
$scope.goBackToState = 'about';
$scope.noColor = true;
}
@ -402,8 +402,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Backup';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Backup');
$scope.goBackToState = 'preferences';
}
}
@ -431,8 +431,8 @@ angular
},
'topbar': {
templateUrl: 'views/includes/topbar.html',
controller: function($scope) {
$scope.titleSection = 'Add wallet';
controller: function($scope, gettext) {
$scope.titleSection = gettext('Add wallet');
$scope.closeToHome = true;
$scope.noColor = true;
}

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService, $timeout) {
angular.module('copayApp.services').factory('txStatus', function($modal, lodash, profileService, $timeout, gettext) {
var root = {};
root.notify = function(txp, cb) {
@ -10,17 +10,17 @@ angular.module('copayApp.services').factory('txStatus', function($modal, lodash,
var status = txp.status;
if (status == 'broadcasted') {
msg = 'Transaction broadcasted';
msg = gettext('Transaction broadcasted');
} else {
var action = lodash.find(txp.actions, {
copayerId: fc.credentials.copayerId
});
if (!action) {
msg = 'Transaction proposal created';
msg = gettext('Transaction proposal created');
} else if (action.type == 'accept') {
msg = 'Transaction proposal signed';
msg = gettext('Transaction proposal signed');
} else if (action.type == 'reject') {
msg = 'Transaction was rejected';
msg = gettext('Transaction was rejected');
}
}