-
Notifications
You must be signed in to change notification settings - Fork 172
Fixed translations and Blackbytes QR code #254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,10 @@ <h1 class="title ellipsis" ng-style="{'color':color}" translate> | |
<h4 class="title m0" translate>QR Code</h4> | ||
<ul class="no-bullet size-14 m0"> | ||
<li class="line-b p10 oh text-center"> | ||
<qrcode size="220" version="6" data="{{protocol}}:{{addr + '?amount=' + amountInSmallestUnits + asset_param}}"></qrcode> | ||
<qrcode size="220" version="{{qr_version}}" data="{{protocol}}:{{code}}"></qrcode> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I din't find where code is set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its in wallethome.js @ line 446 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wallethome.js is not even in the diff |
||
<div class="m10t text-center" ng-show="isCordova"> | ||
<span class="button outline dark-gray tiny round" | ||
ng-click="shareAddress('{{protocol}}:' + addr + '?amount=' + amountInSmallestUnits + asset_param)"> | ||
ng-click="shareAddress('{{protocol}}:{{code}}')"> | ||
<i class="fi-share"></i> | ||
<span translate>Share address</span> | ||
</span> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,8 +179,8 @@ angular.module('copayApp.controllers').controller('correspondentDeviceController | |
$scope.color = fc.backgroundColor; | ||
$scope.bWorking = false; | ||
$scope.arrRelations = ["=", ">", "<", ">=", "<=", "!="]; | ||
$scope.arrParties = [{value: 'me', display_value: "I"}, {value: 'peer', display_value: "the peer"}]; | ||
$scope.arrPeerPaysTos = [{value: 'me', display_value: "to me"}, {value: 'contract', display_value: "to this contract"}]; | ||
$scope.arrParties = [{value: 'me', display_value: gettext("I")}, {value: 'peer', display_value: gettext("the peer")}]; | ||
$scope.arrPeerPaysTos = [{value: 'me', display_value: gettext("to me")}, {value: 'contract', display_value: gettext("to this contract")}]; | ||
$scope.arrAssetInfos = indexScope.arrBalances.map(function(b){ | ||
var info = {asset: b.asset, is_private: b.is_private}; | ||
if (b.asset === 'base') | ||
|
@@ -190,7 +190,7 @@ angular.module('copayApp.controllers').controller('correspondentDeviceController | |
else if (profileService.assetMetadata[b.asset]) | ||
info.displayName = profileService.assetMetadata[b.asset].name; | ||
else | ||
info.displayName = 'of '+b.asset.substr(0, 4); | ||
info.displayName = gettext('of')+' '+b.asset.substr(0, 4); | ||
return info; | ||
}); | ||
$scope.arrPublicAssetInfos = $scope.arrAssetInfos.filter(function(b){ return !b.is_private; }); | ||
|
@@ -262,13 +262,13 @@ angular.module('copayApp.controllers').controller('correspondentDeviceController | |
if (contract.peerAsset === "base") | ||
peer_amount *= walletSettings.unitValue; | ||
if (contract.peerAsset === constants.BLACKBYTES_ASSET) | ||
throw Error("peer asset cannot be blackbytes"); | ||
throw Error(gettext("peer asset cannot be blackbytes")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't need to translate exceptions There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok |
||
if (profileService.assetMetadata[contract.peerAsset]) | ||
peer_amount *= Math.pow(10, profileService.assetMetadata[contract.peerAsset].decimals || 0); | ||
peer_amount = Math.round(peer_amount); | ||
|
||
if (my_amount === peer_amount && contract.myAsset === contract.peerAsset && contract.peer_pays_to === 'contract'){ | ||
$scope.error = "The amounts are equal, you cannot require the peer to pay to the contract. Please either change the amounts slightly or fund the entire contract yourself and require the peer to pay his half to you."; | ||
$scope.error = gettext("The amounts are equal, you cannot require the peer to pay to the contract. Please either change the amounts slightly or fund the entire contract yourself and require the peer to pay his half to you."); | ||
$timeout(function() { | ||
$scope.$digest(); | ||
}, 1); | ||
|
@@ -376,9 +376,9 @@ angular.module('copayApp.controllers').controller('correspondentDeviceController | |
profileService.bKeepUnlocked = false; | ||
if (err){ | ||
if (err.match(/device address/)) | ||
err = "This is a private asset, please send it only by clicking links from chat"; | ||
err = gettext("This is a private asset, please send it only by clicking links from chat"); | ||
if (err.match(/no funded/)) | ||
err = "Not enough spendable funds, make sure all your funds are confirmed"; | ||
err = gettext("Not enough spendable funds, make sure all your funds are confirmed"); | ||
if ($scope) | ||
$scope.error = err; | ||
return; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ | |
|
||
var eventBus = require('byteballcore/event_bus.js'); | ||
|
||
|
||
|
||
angular.module('copayApp.controllers').controller('inviteCorrespondentDeviceController', | ||
function($scope, $timeout, profileService, go, isCordova, correspondentListService, gettextCatalog) { | ||
|
||
|
@@ -42,25 +44,8 @@ angular.module('copayApp.controllers').controller('inviteCorrespondentDeviceCont | |
correspondentListService.startWaitingForPairing(function(pairingInfo){ | ||
console.log("beginAddCorrespondent " + pairingInfo.pairing_secret); | ||
$scope.code = pairingInfo.device_pubkey + "@" + pairingInfo.hub + "#" + pairingInfo.pairing_secret; | ||
|
||
function determineQRcodeVersionFromString( inputtext ) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what was the point of moving the function to the service? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. because the function is now used in both wallethome.js and invitecorrespondentDevice.js There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wallethome.js is not included in the diff |
||
// maximum characters per QR code version using ECC level m | ||
// source: http://www.qrcode.com/en/about/version.html | ||
var maxCharsforQRVersion = [0,14,26,42,62,84,106,122,152,180,213]; | ||
var qrversion = 5; | ||
// find lowest version number that has enough space for our text | ||
for (var i = (maxCharsforQRVersion.length-1); i > 0 ; i--) { | ||
if ( maxCharsforQRVersion[i] >= inputtext.length) | ||
{ | ||
qrversion = i; | ||
} | ||
} | ||
|
||
return qrversion; | ||
} | ||
|
||
var qrstring = $scope.protocol + ":" +$scope.code; //as passed to the qr generator in inviteCorrespondentDevice.html | ||
$scope.qr_version = determineQRcodeVersionFromString( qrstring ); | ||
$scope.qr_version = correspondentListService.determineQRcodeVersionFromString( qrstring ); | ||
|
||
$scope.$digest(); | ||
//$timeout(function(){$scope.$digest();}, 100); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe outside the class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok