add translations to confirm view

This commit is contained in:
Gabriel Bazán 2016-12-05 12:30:43 -03:00
commit e4ec1ab3a8

View file

@ -442,18 +442,18 @@ angular.module('copayApp.controllers').controller('confirmController', function(
if ($scope.isGlidera) { if ($scope.isGlidera) {
$scope.get2faCode(function(err, sent) { $scope.get2faCode(function(err, sent) {
if (err) { if (err) {
popupService.showAlert('Error', 'Could not send confirmation code to your phone'); popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not send confirmation code to your phone'));
return; return;
} }
if (sent) { if (sent) {
var title = "Please, enter the code below"; var title = gettextCatalog.getString("Please, enter the code below");
var message = "A SMS containing a confirmation code was sent to your phone."; var message = gettextCatalog.getString("A SMS containing a confirmation code was sent to your phone.");
popupService.showPrompt(title, message, null, function(twoFaCode) { popupService.showPrompt(title, message, null, function(twoFaCode) {
if (typeof twoFaCode == 'undefined') return; if (typeof twoFaCode == 'undefined') return;
if ($scope.glideraBuy) { if ($scope.glideraBuy) {
$scope.buyRequest(wallet, twoFaCode, function(err, data) { $scope.buyRequest(wallet, twoFaCode, function(err, data) {
if (err) { if (err) {
popupService.showAlert('Error', err); popupService.showAlert(gettextCatalog.getString('Error'), err);
return; return;
} }
$scope.sendStatus = 'success'; $scope.sendStatus = 'success';
@ -465,7 +465,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
if ($scope.glideraSell) { if ($scope.glideraSell) {
$scope.sellRequest(wallet, twoFaCode, function(err, data) { $scope.sellRequest(wallet, twoFaCode, function(err, data) {
if (err) { if (err) {
popupService.showAlert('Error', err); popupService.showAlert(gettextCatalog.getString('Error'), err);
return; return;
} }
$scope.sendStatus = 'success'; $scope.sendStatus = 'success';
@ -614,7 +614,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
walletService.getAddress(wallet, false, function(err, walletAddr) { walletService.getAddress(wallet, false, function(err, walletAddr) {
if (err) { if (err) {
ongoingProcess.set('buyingBitcoin', false); ongoingProcess.set('buyingBitcoin', false);
popupService.showAlert('Error', bwcError.cb(err, 'Could not create address')); popupService.showAlert(gettextCatalog.getString('Error'), bwcError.cb(err, 'Could not create address'));
return; return;
} }
var data = { var data = {
@ -642,13 +642,13 @@ angular.module('copayApp.controllers').controller('confirmController', function(
walletService.getAddress(wallet, null, function(err, refundAddress) { walletService.getAddress(wallet, null, function(err, refundAddress) {
if (!refundAddress) { if (!refundAddress) {
ongoingProcess.clear(); ongoingProcess.clear();
popupService.showAlert('Error', bwcError.msg(err, 'Could not create address')); popupService.showAlert(gettextCatalog.getString('Error'), bwcError.msg(err, 'Could not create address'));
return; return;
} }
glideraService.getSellAddress($scope.glideraAccessToken, function(err, sellAddress) { glideraService.getSellAddress($scope.glideraAccessToken, function(err, sellAddress) {
if (!sellAddress || err) { if (!sellAddress || err) {
ongoingProcess.clear(); ongoingProcess.clear();
popupService.showAlert('Error', 'Could not get the destination bitcoin address'); popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Could not get the destination bitcoin address'));
return; return;
} }
var amount = parseInt(($scope.sellPrice.qty * 100000000).toFixed(0)); var amount = parseInt(($scope.sellPrice.qty * 100000000).toFixed(0));
@ -676,27 +676,27 @@ angular.module('copayApp.controllers').controller('confirmController', function(
walletService.createTx(wallet, txp, function(err, createdTxp) { walletService.createTx(wallet, txp, function(err, createdTxp) {
ongoingProcess.clear(); ongoingProcess.clear();
if (err) { if (err) {
popupService.showAlert('Error', err.message || bwcError.msg(err)); popupService.showAlert(gettextCatalog.getString('Error'), err.message || bwcError.msg(err));
return; return;
} }
walletService.prepare(wallet, function(err, password) { walletService.prepare(wallet, function(err, password) {
if (err) { if (err) {
ongoingProcess.clear(); ongoingProcess.clear();
popupService.showAlert('Error', err.message || bwcError.msg(err)); popupService.showAlert(gettextCatalog.getString('Error'), err.message || bwcError.msg(err));
return; return;
} }
ongoingProcess.set('signingTx', true); ongoingProcess.set('signingTx', true);
walletService.publishTx(wallet, createdTxp, function(err, publishedTxp) { walletService.publishTx(wallet, createdTxp, function(err, publishedTxp) {
if (err) { if (err) {
ongoingProcess.clear(); ongoingProcess.clear();
popupService.showAlert('Error', err.message ||  bwcError.msg(err)); popupService.showAlert(gettextCatalog.getString('Error'), err.message ||  bwcError.msg(err));
return; return;
} }
walletService.signTx(wallet, publishedTxp, password, function(err, signedTxp) { walletService.signTx(wallet, publishedTxp, password, function(err, signedTxp) {
if (err) { if (err) {
ongoingProcess.clear(); ongoingProcess.clear();
popupService.showAlert('Error', err.message ||  bwcError.msg(err)); popupService.showAlert(gettextCatalog.getString('Error'), err.message ||  bwcError.msg(err));
walletService.removeTx(wallet, signedTxp, function(err) { walletService.removeTx(wallet, signedTxp, function(err) {
if (err) $log.debug(err); if (err) $log.debug(err);
}); });
@ -714,7 +714,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
glideraService.sell($scope.glideraAccessToken, twoFaCode, data, function(err, data) { glideraService.sell($scope.glideraAccessToken, twoFaCode, data, function(err, data) {
ongoingProcess.clear(); ongoingProcess.clear();
if (err) { if (err) {
popupService.showAlert('Error', err.message ||  bwcError.msg(err)); popupService.showAlert(gettextCatalog.getString('Error'), err.message ||  bwcError.msg(err));
return; return;
} }
return cb(err, data) return cb(err, data)
@ -733,7 +733,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
price.qty = (toAmount * satToBtc).toFixed(8); price.qty = (toAmount * satToBtc).toFixed(8);
glideraService.buyPrice($scope.glideraAccessToken, price, function(err, buyPrice) { glideraService.buyPrice($scope.glideraAccessToken, price, function(err, buyPrice) {
if (err) { if (err) {
popupService.showAlert('Error', 'Could not get exchange information. Please, try again'); popupService.showAlert(gettextCatalog.getString('Error'), 'Could not get exchange information. Please, try again');
return; return;
} }
$scope.buyPrice = buyPrice; $scope.buyPrice = buyPrice;
@ -747,7 +747,7 @@ angular.module('copayApp.controllers').controller('confirmController', function(
glideraService.sellPrice($scope.glideraAccessToken, price, function(err, sellPrice) { glideraService.sellPrice($scope.glideraAccessToken, price, function(err, sellPrice) {
if (err) { if (err) {
popupService.showAlert('Error', 'Could not get exchange information. Please, try again'); popupService.showAlert(gettextCatalog.getString('Error'), 'Could not get exchange information. Please, try again');
return; return;
} }
$scope.sellPrice = sellPrice; $scope.sellPrice = sellPrice;