Added strings to translate. Updates spanish

This commit is contained in:
Gustavo Maximiliano Cortez 2015-04-30 13:03:30 -03:00
commit ecee13d96f
No known key found for this signature in database
GPG key ID: 15EDAD8D9F2EB1AF
13 changed files with 206 additions and 71 deletions

View file

@ -36,6 +36,10 @@ msgstr ""
"* Usted puede instalar la copia de seguridad en otro dispositivo y usar el " "* Usted puede instalar la copia de seguridad en otro dispositivo y usar el "
"monedero al mismo tiempo en varios dispositivos." "monedero al mismo tiempo en varios dispositivos."
#: src/js/services/notificationsService.js
msgid "A transaction was finally rejected"
msgstr "Transacción finalmente rechazada"
#: src/js/routes.js #: src/js/routes.js
msgid "About" msgid "About"
msgstr "Acerca de" msgstr "Acerca de"
@ -179,9 +183,9 @@ msgstr ""
msgid "Copy to clipboard" msgid "Copy to clipboard"
msgstr "Copiar al portapapeles" msgstr "Copiar al portapapeles"
#: src/js/controllers/create.js #: src/js/services/profileService.js
msgid "Could not create wallet:" msgid "Could not create using the specified extended private key"
msgstr "No se puede crear el monedero" msgstr "No se pudo crear el monedero usando la clave privada ingresada"
#: src/js/controllers/import.js #: src/js/controllers/import.js
msgid "Could not decrypt file, check your password" msgid "Could not decrypt file, check your password"
@ -195,6 +199,14 @@ msgstr "No se pudo obtener información del pago"
msgid "Could not fetch transaction history" msgid "Could not fetch transaction history"
msgstr "No se pudo obtener el historial de transacciones" msgstr "No se pudo obtener el historial de transacciones"
#: src/js/services/profileService.js
msgid "Could not import. Check input file and password"
msgstr "No se pudo importar. Verifique el archivo y su contraseña"
#: src/js/services/profileService.js
msgid "Could not join using the specified extended private key"
msgstr "No se pudo unir al monedero usando la clave privada ingresada"
#: src/js/controllers/join.js #: src/js/controllers/join.js
msgid "Could not join wallet:" msgid "Could not join wallet:"
msgstr "No se pudo unir al monedero:" msgstr "No se pudo unir al monedero:"
@ -271,6 +283,18 @@ msgstr "Inglés"
msgid "Enter your password" msgid "Enter your password"
msgstr "Escribe tu contraseña" msgstr "Escribe tu contraseña"
#: src/js/services/profileService.js
msgid "Error creating wallet"
msgstr "Error al crear monedero"
#: src/js/services/profileService.js
msgid "Error creating wallet. Check your internet connection"
msgstr "Error al crear monedero. Verifique su conexión a internet"
#: src/js/services/profileService.js
msgid "Error importing wallet:"
msgstr "Error al importar monedero: "
#: public/views/modals/paypro.html public/views/modals/txp-details.html #: public/views/modals/paypro.html public/views/modals/txp-details.html
msgid "Expires" msgid "Expires"
msgstr "Expira" msgstr "Expira"
@ -283,14 +307,19 @@ msgstr "Falló al importar monederos"
msgid "Family vacation funds" msgid "Family vacation funds"
msgstr "Fondos para vacaciones en familia" msgstr "Fondos para vacaciones en familia"
#. Get information of payment if using Payment Protocol
#: src/js/controllers/walletHome.js #: src/js/controllers/walletHome.js
msgid "Fetching Payment Informantion" msgid "Fetching Payment Information"
msgstr "Buscando información del pago" msgstr "Obteniendo información del pago"
#: src/js/controllers/index.js #: src/js/controllers/index.js
msgid "French" msgid "French"
msgstr "Francés" msgstr "Francés"
#: src/js/services/notificationsService.js
msgid "Funds received"
msgstr "Fondos Recibidos"
#: public/views/walletHome.html #: public/views/walletHome.html
msgid "Generate new address" msgid "Generate new address"
msgstr "Generar nueva dirección" msgstr "Generar nueva dirección"
@ -347,6 +376,10 @@ msgstr "Importar monedero"
msgid "Importing wallet..." msgid "Importing wallet..."
msgstr "Importando monedero..." msgstr "Importando monedero..."
#: public/views/importLegacy.html
msgid "Importing..."
msgstr "Importando..."
#: public/views/modals/tx-details.html public/views/modals/txp-details.html #: public/views/modals/tx-details.html public/views/modals/txp-details.html
msgid "Information" msgid "Information"
msgstr "Información" msgstr "Información"
@ -423,6 +456,10 @@ msgstr "Mi dirección Bitcoin"
msgid "Network" msgid "Network"
msgstr "Red" msgstr "Red"
#: src/js/services/notificationsService.js
msgid "New Transaction"
msgstr "Nueva Transacción"
#: public/views/modals/confirmation.html #: public/views/modals/confirmation.html
msgid "No" msgid "No"
msgstr "No" msgstr "No"
@ -454,6 +491,10 @@ msgstr ""
"La contraseña no se puede recuperar. Asegúrese de escribirla en un lugar " "La contraseña no se puede recuperar. Asegúrese de escribirla en un lugar "
"seguro" "seguro"
#: src/js/services/profileService.js
msgid "Password needed"
msgstr "Contraseña requerida"
#: src/js/controllers/password.js #: src/js/controllers/password.js
msgid "Passwords do not match" msgid "Passwords do not match"
msgstr "Las contraseñas no coinciden" msgstr "Las contraseñas no coinciden"
@ -553,6 +594,10 @@ msgstr "Repite la contraseña"
msgid "Required" msgid "Required"
msgstr "Requerido" msgstr "Requerido"
#: public/views/createProfile.html
msgid "Retrying..."
msgstr "Reintentando..."
#: public/views/includes/password.html #: public/views/includes/password.html
msgid "SET" msgid "SET"
msgstr "ESTABLECER" msgstr "ESTABLECER"
@ -569,6 +614,10 @@ msgstr "COMENZAR"
msgid "Save" msgid "Save"
msgstr "Guardar" msgstr "Guardar"
#: src/js/services/notificationsService.js
msgid "Scan Finished"
msgstr "Escáner Finalizado"
#: public/views/walletHome.html #: public/views/walletHome.html
msgid "Scan status finished with error" msgid "Scan status finished with error"
msgstr "El escáner del estado finalizó con error" msgstr "El escáner del estado finalizó con error"
@ -721,6 +770,18 @@ msgstr "Balance total bloqueado"
msgid "Transaction" msgid "Transaction"
msgstr "Transacción" msgstr "Transacción"
#: src/js/services/notificationsService.js
msgid "Transaction Rejected"
msgstr "Transacción Rechazada"
#: src/js/services/notificationsService.js
msgid "Transaction Sent"
msgstr "Transacción Enviada"
#: src/js/services/notificationsService.js
msgid "Transaction Signed"
msgstr "Transacción Firmada"
#: public/views/modals/txp-details.html #: public/views/modals/txp-details.html
msgid "Transaction accepted..." msgid "Transaction accepted..."
msgstr "Transacción aceptada..." msgstr "Transacción aceptada..."
@ -833,6 +894,10 @@ msgstr "Esperando copayers"
msgid "Waiting..." msgid "Waiting..."
msgstr "Esperando..." msgstr "Esperando..."
#: src/js/services/profileService.js
msgid "Wallet Already Imported:"
msgstr "Este monedero ya fue importado: "
#: public/views/join.html #: public/views/join.html
msgid "Wallet Invitation" msgid "Wallet Invitation"
msgstr "Invitación para unirse al monedero" msgstr "Invitación para unirse al monedero"
@ -841,6 +906,10 @@ msgstr "Invitación para unirse al monedero"
msgid "Wallet Invitation is not valid!" msgid "Wallet Invitation is not valid!"
msgstr "¡Invitación no válida!" msgstr "¡Invitación no válida!"
#: src/js/services/profileService.js
msgid "Wallet already exists"
msgstr "El monedero ya existe"
#: public/views/copayers.html #: public/views/copayers.html
msgid "Wallet incomplete and broken" msgid "Wallet incomplete and broken"
msgstr "Monedero incompleto y roto" msgstr "Monedero incompleto y roto"
@ -853,6 +922,10 @@ msgstr "Nombre del monedero"
msgid "Warning!" msgid "Warning!"
msgstr "¡Advertencia!" msgstr "¡Advertencia!"
#: src/js/services/profileService.js
msgid "Wrong password"
msgstr "Contraseña incorrecta"
#: public/views/modals/confirmation.html #: public/views/modals/confirmation.html
msgid "Yes" msgid "Yes"
msgstr "Si" msgstr "Si"
@ -918,6 +991,9 @@ msgstr ""
"{{len}} monederos importados. Escáner de fondos en progreso. Espere a ver el " "{{len}} monederos importados. Escáner de fondos en progreso. Espere a ver el "
"balance actualizado" "balance actualizado"
#~ msgid "Could not create wallet:"
#~ msgstr "No se puede crear el monedero"
#~ msgid "OK" #~ msgid "OK"
#~ msgstr "LISTO" #~ msgstr "LISTO"
@ -1123,15 +1199,9 @@ msgstr ""
#~ msgid "Fatal error connecting to Insight server" #~ msgid "Fatal error connecting to Insight server"
#~ msgstr "Error fatal al conectar con el servidor Insight" #~ msgstr "Error fatal al conectar con el servidor Insight"
#~ msgid "Finished"
#~ msgstr "Finalizado"
#~ msgid "Form Error" #~ msgid "Form Error"
#~ msgstr "Error en formulario" #~ msgstr "Error en formulario"
#~ msgid "Funds received!"
#~ msgstr "¡Fondos recibidos!"
#~ msgid "Get QR code" #~ msgid "Get QR code"
#~ msgstr "Obtener código QR" #~ msgstr "Obtener código QR"
@ -1532,9 +1602,6 @@ msgstr ""
#~ "contraseña. Puedes guardar los datos encriptados en tu dispositivo o " #~ "contraseña. Puedes guardar los datos encriptados en tu dispositivo o "
#~ "remotamente en la nube (Servidor Insight)." #~ "remotamente en la nube (Servidor Insight)."
#~ msgid "Wrong password"
#~ msgstr "Contraseña incorrecta"
#~ msgid "You can import your current wallets after" #~ msgid "You can import your current wallets after"
#~ msgstr "Puedes importar tus monederos después" #~ msgstr "Puedes importar tus monederos después"
@ -1651,9 +1718,6 @@ msgstr ""
#~ msgid "Manual Update" #~ msgid "Manual Update"
#~ msgstr "Actualización Manual" #~ msgstr "Actualización Manual"
#~ msgid "New Wallet Created"
#~ msgstr "Nuevo Monedero Creado"
#~ msgid "No transactions proposals yet." #~ msgid "No transactions proposals yet."
#~ msgstr "Sin propuestas de transacciones aún." #~ msgstr "Sin propuestas de transacciones aún."

View file

@ -16,6 +16,10 @@ msgstr ""
msgid "* You can safely install your backup on other device and use your wallet from many devices at the same time." msgid "* You can safely install your backup on other device and use your wallet from many devices at the same time."
msgstr "" msgstr ""
#: src/js/services/notificationsService.js
msgid "A transaction was finally rejected"
msgstr ""
#: src/js/routes.js #: src/js/routes.js
msgid "About" msgid "About"
msgstr "" msgstr ""
@ -165,8 +169,8 @@ msgstr ""
msgid "Copy to clipboard" msgid "Copy to clipboard"
msgstr "" msgstr ""
#: src/js/controllers/create.js #: src/js/services/profileService.js
msgid "Could not create wallet:" msgid "Could not create using the specified extended private key"
msgstr "" msgstr ""
#: src/js/controllers/import.js #: src/js/controllers/import.js
@ -181,6 +185,14 @@ msgstr ""
msgid "Could not fetch transaction history" msgid "Could not fetch transaction history"
msgstr "" msgstr ""
#: src/js/services/profileService.js
msgid "Could not import. Check input file and password"
msgstr ""
#: src/js/services/profileService.js
msgid "Could not join using the specified extended private key"
msgstr ""
#: src/js/controllers/join.js #: src/js/controllers/join.js
msgid "Could not join wallet:" msgid "Could not join wallet:"
msgstr "" msgstr ""
@ -261,6 +273,18 @@ msgstr ""
msgid "Enter your password" msgid "Enter your password"
msgstr "" msgstr ""
#: src/js/services/profileService.js
msgid "Error creating wallet"
msgstr ""
#: src/js/services/profileService.js
msgid "Error creating wallet. Check your internet connection"
msgstr ""
#: src/js/services/profileService.js
msgid "Error importing wallet:"
msgstr ""
#: public/views/modals/paypro.html #: public/views/modals/paypro.html
#: public/views/modals/txp-details.html #: public/views/modals/txp-details.html
msgid "Expires" msgid "Expires"
@ -274,14 +298,19 @@ msgstr ""
msgid "Family vacation funds" msgid "Family vacation funds"
msgstr "" msgstr ""
#. Get information of payment if using Payment Protocol
#: src/js/controllers/walletHome.js #: src/js/controllers/walletHome.js
msgid "Fetching Payment Informantion" msgid "Fetching Payment Information"
msgstr "" msgstr ""
#: src/js/controllers/index.js #: src/js/controllers/index.js
msgid "French" msgid "French"
msgstr "" msgstr ""
#: src/js/services/notificationsService.js
msgid "Funds received"
msgstr ""
#: public/views/walletHome.html #: public/views/walletHome.html
msgid "Generate new address" msgid "Generate new address"
msgstr "" msgstr ""
@ -340,6 +369,10 @@ msgstr ""
msgid "Importing wallet..." msgid "Importing wallet..."
msgstr "" msgstr ""
#: public/views/importLegacy.html
msgid "Importing..."
msgstr ""
#: public/views/modals/tx-details.html #: public/views/modals/tx-details.html
#: public/views/modals/txp-details.html #: public/views/modals/txp-details.html
msgid "Information" msgid "Information"
@ -422,6 +455,10 @@ msgstr ""
msgid "Network" msgid "Network"
msgstr "" msgstr ""
#: src/js/services/notificationsService.js
msgid "New Transaction"
msgstr ""
#: public/views/modals/confirmation.html #: public/views/modals/confirmation.html
msgid "No" msgid "No"
msgstr "" msgstr ""
@ -453,6 +490,10 @@ msgstr ""
msgid "Password cannot be recovered. Be sure to write it down" msgid "Password cannot be recovered. Be sure to write it down"
msgstr "" msgstr ""
#: src/js/services/profileService.js
msgid "Password needed"
msgstr ""
#: src/js/controllers/password.js #: src/js/controllers/password.js
msgid "Passwords do not match" msgid "Passwords do not match"
msgstr "" msgstr ""
@ -552,6 +593,10 @@ msgstr ""
msgid "Required" msgid "Required"
msgstr "" msgstr ""
#: public/views/createProfile.html
msgid "Retrying..."
msgstr ""
#: public/views/includes/password.html #: public/views/includes/password.html
msgid "SET" msgid "SET"
msgstr "" msgstr ""
@ -568,6 +613,10 @@ msgstr ""
msgid "Save" msgid "Save"
msgstr "" msgstr ""
#: src/js/services/notificationsService.js
msgid "Scan Finished"
msgstr ""
#: public/views/walletHome.html #: public/views/walletHome.html
msgid "Scan status finished with error" msgid "Scan status finished with error"
msgstr "" msgstr ""
@ -716,6 +765,18 @@ msgstr ""
msgid "Transaction" msgid "Transaction"
msgstr "" msgstr ""
#: src/js/services/notificationsService.js
msgid "Transaction Rejected"
msgstr ""
#: src/js/services/notificationsService.js
msgid "Transaction Sent"
msgstr ""
#: src/js/services/notificationsService.js
msgid "Transaction Signed"
msgstr ""
#: public/views/modals/txp-details.html #: public/views/modals/txp-details.html
msgid "Transaction accepted..." msgid "Transaction accepted..."
msgstr "" msgstr ""
@ -830,6 +891,10 @@ msgstr ""
msgid "Waiting..." msgid "Waiting..."
msgstr "" msgstr ""
#: src/js/services/profileService.js
msgid "Wallet Already Imported:"
msgstr ""
#: public/views/join.html #: public/views/join.html
msgid "Wallet Invitation" msgid "Wallet Invitation"
msgstr "" msgstr ""
@ -838,6 +903,10 @@ msgstr ""
msgid "Wallet Invitation is not valid!" msgid "Wallet Invitation is not valid!"
msgstr "" msgstr ""
#: src/js/services/profileService.js
msgid "Wallet already exists"
msgstr ""
#: public/views/copayers.html #: public/views/copayers.html
msgid "Wallet incomplete and broken" msgid "Wallet incomplete and broken"
msgstr "" msgstr ""
@ -850,6 +919,10 @@ msgstr ""
msgid "Warning!" msgid "Warning!"
msgstr "" msgstr ""
#: src/js/services/profileService.js
msgid "Wrong password"
msgstr ""
#: public/views/modals/confirmation.html #: public/views/modals/confirmation.html
msgid "Yes" msgid "Yes"
msgstr "" msgstr ""

View file

@ -6,7 +6,7 @@
<div ng-include="'views/includes/version.html'"></div> <div ng-include="'views/includes/version.html'"></div>
</div> </div>
<div class="text-center size-12 text-warning" ng-show="cp.error"> <div class="text-center size-12 text-warning" ng-show="cp.error">
{{(cp.error)|translate}}. Retrying... {{(cp.error)|translate}}. <span translate>Retrying...</span>
</div> </div>
<div class="onGoingProcess" ng-show="cp.creatingProfile"> <div class="onGoingProcess" ng-show="cp.creatingProfile">
<div class="onGoingProcess-content" ng-style="{'background-color':'#222'}"> <div class="onGoingProcess-content" ng-style="{'background-color':'#222'}">

View file

@ -7,10 +7,10 @@
</div> </div>
<div> <div>
<div ng-show="importLegacy.importing"> <div ng-show="importLegacy.importing">
<h1 class="m20b animated infinite flash"> Importing...</h1> <h1 class="m20b animated infinite flash" translate>Importing...</h1>
<ul> <ul>
<li ng-repeat="m in importLegacy.messages"> <li ng-repeat="m in importLegacy.messages">
<span ng-style="{'opacity':m.opacity}"> {{m.message}} </span> <span ng-style="{'opacity':m.opacity}">{{m.message|translate}}</span>
</ul> </ul>
</div> </div>

View file

@ -61,7 +61,7 @@ angular.module('copayApp.controllers').controller('createController',
self.loading = false; self.loading = false;
if (err) { if (err) {
$log.debug(err); $log.debug(err);
self.error = gettext('Could not create wallet: ') + err; self.error = err;
} }
else { else {
go.walletHome(); go.walletHome();

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('importController', 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; var self = this;
@ -17,15 +17,20 @@ angular.module('copayApp.controllers').controller('importController',
}); });
var _import = function(str, opts) { var _import = function(str, opts) {
var str2; var str2, err;
try { try {
str2 = sjcl.decrypt(self.password, str); str2 = sjcl.decrypt(self.password, str);
} catch (e) { } catch (e) {
self.error = gettext('Could not decrypt file, check your password'); err = gettext('Could not decrypt file, check your password');
$log.warn(e); $log.warn(e);
return;
}; };
if (err) {
self.error = err;
$rootScope.$apply();
return;
}
self.loading = true; self.loading = true;
$timeout(function() { $timeout(function() {

View file

@ -500,7 +500,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}; };
self.setDefaultLanguage = function(setLang) { self.setDefaultLanguage = function(setLang) {
var userLang var userLang;
if (!setLang) { if (!setLang) {
userLang = configService.getSync().wallet.settings.defaultLanguage; userLang = configService.getSync().wallet.settings.defaultLanguage;
if (!userLang) { if (!userLang) {

View file

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

View file

@ -683,7 +683,8 @@ angular.module('copayApp.controllers').controller('walletHomeController', functi
var satToUnit = 1 / this.unitToSatoshi; var satToUnit = 1 / this.unitToSatoshi;
var self = this; 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); $log.debug('Fetch PayPro Request...', uri);
$timeout(function() { $timeout(function() {

View file

@ -34,6 +34,7 @@ angular
args = args.map(function(v) { args = args.map(function(v) {
try { try {
if (typeof v == 'undefined') v = 'undefined'; if (typeof v == 'undefined') v = 'undefined';
if (!v) v = 'null';
if (typeof v == 'object') { if (typeof v == 'object') {
if (v.message) if (v.message)
v = v.message; v = v.message;

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services') angular.module('copayApp.services')
.factory('notificationService', function profileServiceFactory($filter, notification, lodash, configService) { .factory('notificationService', function profileServiceFactory($filter, notification, lodash, configService, gettext) {
var root = {}; var root = {};
@ -56,32 +56,32 @@ angular.module('copayApp.services')
switch (notificationData.type) { switch (notificationData.type) {
case 'NewTxProposal': case 'NewTxProposal':
notification.new('New Transaction', notification.new(gettext('New Transaction'),
walletName, {color: color} ); walletName, {color: color} );
break; break;
case 'TxProposalAcceptedBy': case 'TxProposalAcceptedBy':
notification.success('Transaction Signed', notification.success(gettext('Transaction Signed'),
walletName, {color: color} ); walletName, {color: color} );
break; break;
case 'TxProposalRejectedBy': case 'TxProposalRejectedBy':
notification.error('Transaction Rejected', notification.error(gettext('Transaction Rejected'),
walletName, {color: color} ); walletName, {color: color} );
break; break;
case 'TxProposalFinallyRejected': case 'TxProposalFinallyRejected':
notification.error('A transaction was finally rejected', notification.error(gettext('A transaction was finally rejected'),
walletName, {color: color} ); walletName, {color: color} );
break; break;
case 'NewOutgoingTx': case 'NewOutgoingTx':
notification.sent('Transaction Sent', notification.sent(gettext('Transaction Sent'),
walletName, {color: color} ); walletName, {color: color} );
break; break;
case 'NewIncomingTx': case 'NewIncomingTx':
notification.funds('Funds received', notification.funds(gettext('Funds received'),
walletName, {color: color} ); walletName, {color: color} );
break; break;
case 'ScanFinished': case 'ScanFinished':
notification.success('Scan Finished', notification.success(gettext('Scan Finished'),
walletName, {color: color} );; walletName, {color: color} );
break; break;
case 'NewCopayer': case 'NewCopayer':

View file

@ -1,6 +1,6 @@
'use strict'; 'use strict';
angular.module('copayApp.services') 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 = {}; var root = {};
@ -163,7 +163,7 @@ angular.module('copayApp.services')
walletClient.createWallet('Personal Wallet', 'me', 1, 1, { walletClient.createWallet('Personal Wallet', 'me', 1, 1, {
network: 'livenet' network: 'livenet'
}, function(err) { }, 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({ var p = Profile.create({
credentials: [JSON.parse(walletClient.export())], credentials: [JSON.parse(walletClient.export())],
}); });
@ -179,13 +179,13 @@ angular.module('copayApp.services')
try { try {
walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey); walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey);
} catch (ex) { } 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, { walletClient.createWallet(opts.name, opts.myName || 'me', opts.m, opts.n, {
network: opts.networkName network: opts.networkName
}, function(err, secret) { }, 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.profile.credentials.push(JSON.parse(walletClient.export()));
root.setWalletClients(); root.setWalletClients();
@ -205,7 +205,7 @@ angular.module('copayApp.services')
try { try {
walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey); walletClient.seedFromExtendedPrivateKey(opts.extendedPrivateKey);
} catch (ex) { } 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) { walletClient.joinWallet(opts.secret, opts.myName || 'me', function(err) {
@ -254,7 +254,7 @@ angular.module('copayApp.services')
password: opts.password password: opts.password
}); });
} catch (err) { } 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; var walletId = walletClient.credentials.walletId;
@ -263,7 +263,7 @@ angular.module('copayApp.services')
if (lodash.find(root.profile.credentials, { if (lodash.find(root.profile.credentials, {
'walletId': walletId 'walletId': walletId
})) { })) {
return cb('Wallet already exists'); return cb(gettext('Wallet already exists'));
} }
root.profile.credentials.push(JSON.parse(walletClient.export())); root.profile.credentials.push(JSON.parse(walletClient.export()));
@ -285,7 +285,6 @@ angular.module('copayApp.services')
root._createNewProfile(function(err, p) { root._createNewProfile(function(err, p) {
if (err) return cb(err); if (err) return cb(err);
console.log('[profileService.js.287]'); //TODO
root.bindProfile(p, function(err) { root.bindProfile(p, function(err) {
storageService.storeNewProfile(p, function(err) { storageService.storeNewProfile(p, function(err) {
return cb(err); return cb(err);
@ -299,11 +298,11 @@ angular.module('copayApp.services')
var walletClient = bwcService.getClient(); var walletClient = bwcService.getClient();
walletClient.createWalletFromOldCopay(username, password, blob, function(err, existed) { 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]) { if (root.walletClients[walletClient.credentials.walletId]) {
$log.debug('Wallet:' + walletClient.credentials.walletName + ' already imported'); $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); $log.debug('Creating Wallet:', walletClient.credentials.walletName);
@ -370,13 +369,13 @@ angular.module('copayApp.services')
$log.debug('Wallet is encrypted'); $log.debug('Wallet is encrypted');
$rootScope.$emit('Local/NeedsPassword', false, function(err2, password) { $rootScope.$emit('Local/NeedsPassword', false, function(err2, password) {
if (err2 || !password) { if (err2 || !password) {
return cb(err2 || 'Password needed'); return cb(err2 || gettext('Password needed'));
} }
try { try {
fc.unlock(password); fc.unlock(password);
} catch (e) { } catch (e) {
$log.debug(e); $log.debug(e);
return cb('Wrong password'); return cb(gettext('Wrong password'));
} }
$timeout(function() { $timeout(function() {
if (fc.isPrivKeyEncrypted()) { if (fc.isPrivKeyEncrypted()) {

View file

@ -63,7 +63,7 @@ angular.module('copayApp.services')
if (err) return cb(err); if (err) return cb(err);
if (!str) return cb(); 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) { fileStorageService.create('profile', str, function(err) {
if (err) cb(err); if (err) cb(err);