Added strings to translate. Updates spanish
This commit is contained in:
parent
cbf3d7cceb
commit
ecee13d96f
13 changed files with 206 additions and 71 deletions
|
|
@ -61,7 +61,7 @@ angular.module('copayApp.controllers').controller('createController',
|
|||
self.loading = false;
|
||||
if (err) {
|
||||
$log.debug(err);
|
||||
self.error = gettext('Could not create wallet: ') + err;
|
||||
self.error = err;
|
||||
}
|
||||
else {
|
||||
go.walletHome();
|
||||
|
|
|
|||
|
|
@ -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 = gettext('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() {
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copayApp.controllers').controller('preferencesDeleteWalletController',
|
||||
function($scope, $rootScope, $filter, $timeout, $modal, notification, profileService, isCordova, go, gettext) {
|
||||
function($scope, $rootScope, $filter, $timeout, $modal, $log, notification, profileService, isCordova, go, gettext, gettextCatalog) {
|
||||
this.isCordova = isCordova;
|
||||
this.error = null;
|
||||
|
||||
|
|
@ -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(gettext('Success'), gettextCatalog.getString('The wallet "{{walletName}}" was deleted', {walletName: walletName}));
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 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() {
|
||||
|
|
|
|||
|
|
@ -683,7 +683,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
|
|||
|
||||
var satToUnit = 1 / this.unitToSatoshi;
|
||||
var self = this;
|
||||
self.setOngoingProcess(gettext('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() {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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':
|
||||
|
|
|
|||
|
|
@ -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()) {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue