From e2024d1df275805874ae8640e1cd5ce5cf3d2fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Fri, 16 Dec 2016 12:06:30 -0300 Subject: [PATCH] fix translations in error popup --- src/js/services/profileService.js | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/js/services/profileService.js b/src/js/services/profileService.js index 9f5665823..e4bef4483 100644 --- a/src/js/services/profileService.js +++ b/src/js/services/profileService.js @@ -1,6 +1,6 @@ 'use strict'; angular.module('copayApp.services') - .factory('profileService', function profileServiceFactory($rootScope, $timeout, $filter, $log, sjcl, lodash, storageService, bwcService, configService, pushNotificationsService, gettext, gettextCatalog, bwcError, uxLanguage, platformInfo, txFormatService, $state) { + .factory('profileService', function profileServiceFactory($rootScope, $timeout, $filter, $log, sjcl, lodash, storageService, bwcService, configService, pushNotificationsService, gettextCatalog, bwcError, uxLanguage, platformInfo, txFormatService, $state) { var isChromeApp = platformInfo.isChromeApp; @@ -361,14 +361,14 @@ angular.module('copayApp.services') } catch (ex) { $log.info(ex); - return cb(gettext('Could not create: Invalid wallet recovery phrase')); + return cb(gettextCatalog.getString('Could not create: Invalid wallet recovery phrase')); } } else if (opts.extendedPrivateKey) { try { walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey); } catch (ex) { $log.warn(ex); - return cb(gettext('Could not create using the specified extended private key')); + return cb(gettextCatalog.getString('Could not create using the specified extended private key')); } } else if (opts.extendedPublicKey) { try { @@ -378,7 +378,7 @@ angular.module('copayApp.services') }); } catch (ex) { $log.warn("Creating wallet from Extended Public Key Arg:", ex, opts); - return cb(gettext('Could not create using the specified extended public key')); + return cb(gettextCatalog.getString('Could not create using the specified extended public key')); } } else { var lang = uxLanguage.getCurrentLanguage(); @@ -421,7 +421,7 @@ angular.module('copayApp.services') singleAddress: opts.singleAddress, walletPrivKey: opts.walletPrivKey, }, function(err, secret) { - if (err) return bwcError.cb(err, gettext('Error creating wallet'), cb); + if (err) return bwcError.cb(err, gettextCatalog.getString('Error creating wallet'), cb); return cb(null, walletClient, secret); }); }); @@ -451,11 +451,11 @@ angular.module('copayApp.services') if (lodash.find(root.profile.credentials, { 'walletId': walletData.walletId })) { - return cb(gettext('Cannot join the same wallet more that once')); + return cb(gettextCatalog.getString('Cannot join the same wallet more that once')); } } catch (ex) { $log.debug(ex); - return cb(gettext('Bad wallet invitation')); + return cb(gettextCatalog.getString('Bad wallet invitation')); } opts.networkName = walletData.network; $log.debug('Joining Wallet:', opts); @@ -464,7 +464,7 @@ angular.module('copayApp.services') if (err) return cb(err); walletClient.joinWallet(opts.secret, opts.myName || 'me', {}, function(err) { - if (err) return bwcError.cb(err, gettext('Could not join wallet'), cb); + if (err) return bwcError.cb(err, gettextCatalog.getString('Could not join wallet'), cb); addAndBindWalletClient(walletClient, { bwsurl: opts.bwsurl }, cb); @@ -521,12 +521,12 @@ angular.module('copayApp.services') // Adds and bind a new client to the profile var addAndBindWalletClient = function(client, opts, cb) { if (!client || !client.credentials) - return cb(gettext('Could not access wallet')); + return cb(gettextCatalog.getString('Could not access wallet')); var walletId = client.credentials.walletId if (!root.profile.addWallet(JSON.parse(client.export()))) - return cb(gettext('Wallet already in Copay')); + return cb(gettextCatalog.getString('Wallet already in Copay')); var skipKeyValidation = root.profile.isChecked(platformInfo.ua, walletId); @@ -595,7 +595,7 @@ angular.module('copayApp.services') password: opts.password }); } catch (err) { - return cb(gettext('Could not import. Check input file and spending password')); + return cb(gettextCatalog.getString('Could not import. Check input file and spending password')); } str = JSON.parse(str); @@ -626,7 +626,7 @@ angular.module('copayApp.services') if (err instanceof errors.NOT_AUTHORIZED) return cb(err); - return bwcError.cb(err, gettext('Could not import'), cb); + return bwcError.cb(err, gettextCatalog.getString('Could not import'), cb); } addAndBindWalletClient(walletClient, { @@ -657,7 +657,7 @@ angular.module('copayApp.services') if (err instanceof errors.NOT_AUTHORIZED) return cb(err); - return bwcError.cb(err, gettext('Could not import'), cb); + return bwcError.cb(err, gettextCatalog.getString('Could not import'), cb); } addAndBindWalletClient(walletClient, { @@ -680,7 +680,7 @@ angular.module('copayApp.services') if (err instanceof errors.NOT_AUTHORIZED) err.name = 'WALLET_DOES_NOT_EXIST'; - return bwcError.cb(err, gettext('Could not import'), cb); + return bwcError.cb(err, gettextCatalog.getString('Could not import'), cb); } addAndBindWalletClient(walletClient, {