Merge pull request #2664 from cmgustavo/feat/language-05

Feat/language 05
This commit is contained in:
Matias Alejo Garcia 2015-04-30 15:58:56 -03:00
commit 7947438396
28 changed files with 763 additions and 257 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 = 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

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.controllers').controller('importController',
function($scope, $rootScope, $location, $timeout, $log, profileService, notification, go, isMobile, isCordova, sjcl) {
function($scope, $rootScope, $location, $timeout, $log, profileService, notification, go, isMobile, isCordova, sjcl, gettext) {
var self = this;
@ -17,15 +17,20 @@ angular.module('copayApp.controllers').controller('importController',
});
var _import = function(str, opts) {
var str2;
var str2, err;
try {
str2 = sjcl.decrypt(self.password, str);
} catch (e) {
self.error = 'Could not decrypt file, check your password';
err = gettext('Could not decrypt file, check your password');
$log.warn(e);
return;
};
if (err) {
self.error = err;
$rootScope.$apply();
return;
}
self.loading = true;
$timeout(function() {
@ -40,7 +45,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 +62,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 +72,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',
}];
@ -500,7 +500,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
};
self.setDefaultLanguage = function(setLang) {
var userLang
var userLang;
if (!setLang) {
userLang = configService.getSync().wallet.settings.defaultLanguage;
if (!userLang) {

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, $log, notification, profileService, isCordova, go, gettext, gettextCatalog) {
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() {
@ -33,25 +33,17 @@ angular.module('copayApp.controllers').controller('preferencesDeleteWalletContro
};
var _deleteWallet = function() {
$timeout(function() {
var fc = profileService.focusedClient;
var walletName = fc.credentials.walletName;
var fc = profileService.focusedClient;
var walletName = fc.credentials.walletName;
var self = this;
profileService.deleteWalletFC({}, function(err) {
if (err) {
this.error = err.message || err;
console.log(err);
$timeout(function() {
$scope.$digest();
});
} else {
go.walletHome();
$timeout(function() {
notification.success('Success', 'The wallet "' + walletName + '" was deleted');
});
}
});
}, 100);
profileService.deleteWalletFC({}, function(err) {
if (err) {
self.error = err.message || err;
} else {
notification.success(gettext('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName}));
}
});
};
this.deleteWallet = function() {

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);
@ -523,7 +523,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;
}
@ -535,7 +535,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;
@ -571,7 +571,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();
@ -581,11 +581,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);
}
@ -685,13 +685,14 @@ 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');
/// Get information of payment if using Payment Protocol
self.setOngoingProcess(gettext('Fetching Payment Information'));
$log.debug('Fetch PayPro Request...', uri);
$timeout(function() {
@ -705,7 +706,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

@ -34,6 +34,7 @@ angular
args = args.map(function(v) {
try {
if (typeof v == 'undefined') v = 'undefined';
if (!v) v = 'null';
if (typeof v == 'object') {
if (v.message)
v = v.message;
@ -145,8 +146,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 +163,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 +185,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 +204,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 +252,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 +271,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 +290,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 +309,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 +347,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 +365,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 +384,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 +403,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 +432,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('notificationService', function profileServiceFactory($filter, notification, lodash, configService) {
.factory('notificationService', function profileServiceFactory($filter, notification, lodash, configService, gettext) {
var root = {};
@ -56,32 +56,32 @@ angular.module('copayApp.services')
switch (notificationData.type) {
case 'NewTxProposal':
notification.new('New Transaction',
notification.new(gettext('New Transaction'),
walletName, {color: color} );
break;
case 'TxProposalAcceptedBy':
notification.success('Transaction Signed',
notification.success(gettext('Transaction Signed'),
walletName, {color: color} );
break;
case 'TxProposalRejectedBy':
notification.error('Transaction Rejected',
notification.error(gettext('Transaction Rejected'),
walletName, {color: color} );
break;
case 'TxProposalFinallyRejected':
notification.error('A transaction was finally rejected',
notification.error(gettext('A transaction was finally rejected'),
walletName, {color: color} );
break;
case 'NewOutgoingTx':
notification.sent('Transaction Sent',
notification.sent(gettext('Transaction Sent'),
walletName, {color: color} );
break;
case 'NewIncomingTx':
notification.funds('Funds received',
notification.funds(gettext('Funds received'),
walletName, {color: color} );
break;
case 'ScanFinished':
notification.success('Scan Finished',
walletName, {color: color} );;
notification.success(gettext('Scan Finished'),
walletName, {color: color} );
break;
case 'NewCopayer':

View file

@ -1,6 +1,6 @@
'use strict';
angular.module('copayApp.services')
.factory('profileService', function profileServiceFactory($rootScope, $location, $timeout, $filter, $log, lodash, storageService, bwcService, configService, notificationService, isChromeApp, isCordova) {
.factory('profileService', function profileServiceFactory($rootScope, $location, $timeout, $filter, $log, lodash, storageService, bwcService, configService, notificationService, isChromeApp, isCordova, gettext) {
var root = {};
@ -163,7 +163,7 @@ angular.module('copayApp.services')
walletClient.createWallet('Personal Wallet', 'me', 1, 1, {
network: 'livenet'
}, function(err) {
if (err) return cb('Error creating wallet. Check your internet connection');
if (err) return cb(gettext('Error creating wallet. Check your internet connection'));
var p = Profile.create({
credentials: [JSON.parse(walletClient.export())],
});
@ -179,13 +179,13 @@ angular.module('copayApp.services')
try {
walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey);
} catch (ex) {
return cb('Could not create using the specified extended private key');
return cb(gettext('Could not create using the specified extended private key'));
}
}
walletClient.createWallet(opts.name, opts.myName || 'me', opts.m, opts.n, {
network: opts.networkName
}, function(err, secret) {
if (err) return cb('Error creating wallet');
if (err) return cb(gettext('Error creating wallet'));
root.profile.credentials.push(JSON.parse(walletClient.export()));
root.setWalletClients();
@ -205,7 +205,7 @@ angular.module('copayApp.services')
try {
walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey);
} catch (ex) {
return cb('Could not join using the specified extended private key');
return cb(gettext('Could not join using the specified extended private key'));
}
}
walletClient.joinWallet(opts.secret, opts.myName || 'me', function(err) {
@ -254,7 +254,7 @@ angular.module('copayApp.services')
password: opts.password
});
} catch (err) {
return cb('Could not import. Check input file and password');
return cb(gettext('Could not import. Check input file and password'));
}
var walletId = walletClient.credentials.walletId;
@ -263,7 +263,7 @@ angular.module('copayApp.services')
if (lodash.find(root.profile.credentials, {
'walletId': walletId
})) {
return cb('Wallet already exists');
return cb(gettext('Wallet already exists'));
}
root.profile.credentials.push(JSON.parse(walletClient.export()));
@ -285,7 +285,6 @@ angular.module('copayApp.services')
root._createNewProfile(function(err, p) {
if (err) return cb(err);
console.log('[profileService.js.287]'); //TODO
root.bindProfile(p, function(err) {
storageService.storeNewProfile(p, function(err) {
return cb(err);
@ -299,11 +298,11 @@ angular.module('copayApp.services')
var walletClient = bwcService.getClient();
walletClient.createWalletFromOldCopay(username, password, blob, function(err, existed) {
if (err) return cb('Error importing wallet: ' + err);
if (err) return cb(gettext('Error importing wallet: ') + err);
if (root.walletClients[walletClient.credentials.walletId]) {
$log.debug('Wallet:' + walletClient.credentials.walletName + ' already imported');
return cb('Wallet Already Imported: ' + walletClient.credentials.walletName);
return cb(gettext('Wallet Already Imported: ') + walletClient.credentials.walletName);
};
$log.debug('Creating Wallet:', walletClient.credentials.walletName);
@ -370,13 +369,13 @@ angular.module('copayApp.services')
$log.debug('Wallet is encrypted');
$rootScope.$emit('Local/NeedsPassword', false, function(err2, password) {
if (err2 || !password) {
return cb(err2 || 'Password needed');
return cb(err2 || gettext('Password needed'));
}
try {
fc.unlock(password);
} catch (e) {
$log.debug(e);
return cb('Wrong password');
return cb(gettext('Wrong password'));
}
$timeout(function() {
if (fc.isPrivKeyEncrypted()) {

View file

@ -63,7 +63,7 @@ angular.module('copayApp.services')
if (err) return cb(err);
if (!str) return cb();
$log.info('Starting Migration profile to File storage...')
$log.info('Starting Migration profile to File storage...');
fileStorageService.create('profile', str, function(err) {
if (err) cb(err);

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');
}
}