Skip to content

Commit

Permalink
Merge branch 'develop' into new_bitcoinjs
Browse files Browse the repository at this point in the history
Conflicts:
	js/model/contacts.js
  • Loading branch information
caedesvvv committed Oct 22, 2014
2 parents 2204c88 + ee45d52 commit 739cbf1
Show file tree
Hide file tree
Showing 88 changed files with 1,287 additions and 577 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ Desktop.ini
/vendors/angular-xeditable/dist/js/xeditable.js
/vendors/angular-mocks/*
!/vendors/angular-mocks/angular-mocks.js
/vendors/angular-translate/*
!/vendors/angular-translate/angular-translate.min.js
/vendors/angular-translate-loader-static-files/*
!/vendors/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js
/vendors/mnemonic.js/*
!/vendors/mnemonic.js/mnemonic.js
/vendors/ngprogress/*
Expand Down
8 changes: 8 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[main]
host = https://www.transifex.com

[darkwallet.darkwallet]
file_filter = i18n/<lang>.json
source_file = i18n/en_US.json
source_lang = en_US
type = KEYVALUEJSON
27 changes: 27 additions & 0 deletions HACKING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,33 @@ ports.
To command the backend, the frontend can access directly in most situations, so just start on DarkWallet
and move down.

Internationalization
--------------------

You can make a string translatable using the "_" filter:

```html
<p>{{'This string is translated to the system language'|_}}<p>
```

You can use **strong** and *emphasis* markdown formatting syntax:

```html
<p ng-bind-html="('I love *darkwallet*'|_)"></p>
```

When you add or modify a new language string, run the following command:

```sh
$ npm run i18n-update
```

Having transifex client downloaded and [configured](http://docs.transifex.com/developer/client/setup#configuration), you can:

```sh
$ tx push -s # Push the sources
$ tx pull -t # Pull the translations

Testing
-------

Expand Down
4 changes: 3 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"angular-xeditable": "~0.1.8",
"async": "~0.7.0",
"angular-moment": "~0.7.0",
"big.js": "~2.5.0"
"big.js": "~2.5.0",
"angular-translate": "~2.2.0",
"angular-translate-loader-static-files": "~2.2.0"
}
}
10 changes: 5 additions & 5 deletions html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,16 @@ <h1 class="hide-for-medium"><a ng-click="titleClick()" id="maintitle"><img id="l
<li ng-show="settings.advanced" title="settings" id="settings" ng-class="{active:isActive('/settings')}"><a href="#settings" class="fa fa-cog"></a></li>


<li ng-show="!settings.advanced" title="settings" id="settings" ng-class="{active:isActive('/settings')}"><a href="#settings"><i class="icon-cog"></i> Settings</a></li>
<li ng-show="!settings.advanced" title="settings" id="settings" ng-class="{active:isActive('/settings')}"><a href="#settings"><i class="icon-cog"></i> {{'Settings'|_}}</a></li>


<li title="identities" ng-class="{active:isActive('/identities')}"><a ng-show="identityName" href="#identities"><i class="icon-profile"></i> {{identityName}}</a></li>
</ul>
<ul class="left">
<li ng-class="{active:isActive('/wallet')}"><a ng-click="openWallet()"><i class="icon-wallet"></i> Wallet</a></li>
<li ng-class="{active:isActive('/send')}"><a href="#send"><i class="icon-rocket"></i> Send</a></li>
<li ng-class="{active:isActive('/contact')}"><a href="#contacts"><i class="icon-contacts"></i> Contacts</a></li>
<li ng-class="{active:isActive('/lobby')}"><a href="#lobby"><i class="icon-chat"></i> Lobby</a></li>
<li ng-class="{active:isActive('/wallet')}"><a ng-click="openWallet()"><i class="icon-wallet"></i> {{'Wallet'|_}}</a></li>
<li ng-class="{active:isActive('/send')}"><a href="#send"><i class="icon-rocket"></i> {{'Send'|_}}</a></li>
<li ng-class="{active:isActive('/contact')}"><a href="#contacts"><i class="icon-contacts"></i> {{'Contacts'|_}}</a></li>
<li ng-class="{active:isActive('/lobby')}"><a href="#lobby"><i class="icon-chat"></i> {{'Lobby'|_}}</a></li>
</ul>
</top-bar-section>
</top-bar>
Expand Down
6 changes: 3 additions & 3 deletions html/modals/ask-password.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div class="large-8 large-centered columns panel radius topmargin">
<form ng-submit="ok(vars.password)">
<h6>{{vars.text}}</h6>
<input auto-focus ng-model="vars.password" type="password" placeholder="Write your password..." />
<button class="button small fa fa-check radius glow" type="submit"> OK</button>
<a class="button alert small radius fa fa-times" ng-click="cancel()"> Cancel</a>
<input auto-focus ng-model="vars.password" type="password" placeholder="{{'Write your password...'|_}}" />
<button class="button small fa fa-check radius glow" type="submit"> {{'Accept'|_}}</button>
<a class="button alert small radius fa fa-times" ng-click="cancel()"> {{'Cancel'|_}}</a>
</form>
</div>
<div class="qractions">
Expand Down
6 changes: 3 additions & 3 deletions html/modals/confirm-delete.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="large-10 large-centered columns panel radius topmargin">
<h6>Are you sure you want to delete <i>{{vars.name}}</i>?</h6>
<h6 ng-bind-html="('Are you sure you want to delete *{0}*?'|_:vars.name)"></h6>
<div class="text-right">
<a class="button alert small radius fa fa-trash-o" ng-click="ok(vars.object)"> Delete</a>
<a class="button small fa radius fa-times glow" ng-click="cancel()"> Cancel</a>
<a class="button alert small radius fa fa-trash-o" ng-click="ok(vars.object)"> {{'Delete'|_}}</a>
<a class="button small fa radius fa-times glow" ng-click="cancel()"> {{'Cancel'|_}}</a>
</div>
</div>
<div class="qractions">
Expand Down
20 changes: 10 additions & 10 deletions html/modals/confirm-send.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,32 @@
<div class="medium-6 columns">
<!-- High Fee warning -->
<div ng-show="(vars.spend.metadata.fee>=100000)||(vars.spend.metadata.fee>vars.spend.metadata.total)">
<h3>Warning: High Fee!</h3>
<h3>{{'Warning: High Fee!'|_}}</h3>
<div ng-show="(vars.spend.metadata.fee>=100000)&&(vars.spend.metadata.fee<1000000)">
<p>Your fee is bigger than reasonable (greater or equal to 1 mBTC), please <b>double check</b> before sending.</p>
<p ng-bind-html="('Your fee is bigger than reasonable (greater or equal to 1 mBTC), please **double check** before sending.'|_)"></p>
</div>
<div ng-show="vars.spend.metadata.fee>=1000000">
<p>Your fee is insanely high (greater or equal to 10 mBTC), please <b>triple check</b> before sending.</p>
<p ng-bind-html="('Your fee is insanely high (greater or equal to 10 mBTC), please **triple check** before sending.'|_)"></p>
</div>
<div ng-show="vars.spend.metadata.fee>vars.spend.metadata.total">
<p>Your fee is greater than your sent amount, please <b>triple check</b> before sending.</p>
<p ng-bind-html="('Your fee is greater than your sent amount, please **triple check** before sending.'|_)"></p>
</div>
</div>

<h3>{{vars.text}}</h3>
<input auto-focus ng-model="vars.password" type="password" placeholder="Write your password..." />
<button class="button small fa fa-check radius glow" type="submit"> OK</button>
<a class="button alert small radius fa fa-times" ng-click="cancel()"> Cancel</a>
<input auto-focus ng-model="vars.password" type="password" placeholder="{{'Write your password...'|_}}" />
<button class="button small fa fa-check radius glow" type="submit"> {{'Accept'|_}}</button>
<a class="button alert small radius fa fa-times" ng-click="cancel()"> {{'Cancel'|_}}</a>
</div>
<div class="medium-6 columns">
<h5>Sending {{vars.spend.metadata.total+vars.spend.metadata.fee | formatBtc}} from "{{vars.spend.pocket.name}}"</h5>
<h5>{{'Sending {0} from {1}'|_:(vars.spend.metadata.total+spend.metadata.fee |formatBtc):vars.spend.pocket.name}}</h5>
<h5 ng-repeat="recipient in vars.recipients">
{{recipient.amount | formatBtc}} ({{recipient.amount | formatFiat}}) <i class="fa fa-arrow-right"></i>
<identicon icon-size="36" hash="recipient.contact.data.hash"></identicon>
{{recipient.contact.data.name}}
</h5>
<h6>Fee: {{vars.spend.metadata.fee | formatBtc}} ({{vars.spend.metadata.fee | formatFiat}})</h6>
<h6 ng-show="vars.spend.metadata.label">Description: {{vars.spend.metadata.label}}</h6>
<h6>{{'Fee'|_}}: {{vars.spend.metadata.fee | formatBtc}} ({{vars.spend.metadata.fee | formatFiat}})</h6>
<h6 ng-show="vars.spend.metadata.label">{{'Description'|_}}: {{vars.spend.metadata.label}}</h6>
</div>
</form>
</div>
Expand Down
4 changes: 2 additions & 2 deletions html/modals/confirm.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<h6>{{vars.message}}</h6>
<p>{{vars.detail}}</p>
<div class="text-right">
<button class="button fa radius fa-check small" ng-click="ok(vars.object)"> Accept</button>
<button class="button alert small radius fa fa-times" ng-click="cancel()"> Cancel</button>
<button class="button fa radius fa-check small" ng-click="ok(vars.object)"> {{'Accept'|_}}</button>
<button class="button alert small radius fa fa-times" ng-click="cancel()"> {{'Cancel'|_}}</button>
</div>
</div>
<div class="qractions">
Expand Down
28 changes: 14 additions & 14 deletions html/modals/import.html
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
<div class="large-10 large-centered columns panel radius topmargin" ng-controller="BackupsCtrl">
<div ng-show="!step">
<h3>Import from file</h3>
<h3>{{'Import from file'|_}}</h3>
<input type="file" id="import-wallet-file"></input>
</div>
<div ng-show="step=='unlock'">
<h3>{{importFile.name}} <span class="label radius">{{importFile.size}} kB</span></h3>
<p>This file is password protected, write the password to unlock</p>
<p>{{'This file is password protected, write the password to unlock'|_}}</p>
<form name="passwordInput" ng-submit="unlockBackup()">
<input ng-model="password" type="password" placeholder="Write your password..." autofocus required />
<input ng-model="password" type="password" placeholder="{{'Write your password...'|_}}" autofocus required />
<code ng-show="error">{{error}}</code>
<button ng-disabled="!password" class="button small fa fa-check radius glow" type="submit"> OK</button>
<a class="button small alert radius fa fa-times" ng-click="importfile.name=false"> Cancel</a>
<button ng-disabled="!password" class="button small fa fa-check radius glow" type="submit"> {{'Accept'|_}}</button>
<a class="button small alert radius fa fa-times" ng-click="importfile.name=false"> {{'Cancel'|_}}</a>
</form>
</div>

<div ng-show="step=='select'">
<h4>Available identities:</h4>
<h4>{{'Available identities'|_}}:</h4>
<div class="row" ng-repeat="identity in toLoad">
<div class="columns small-3">
<identicon icon-size="32" hash="identity.hash" title="{{identity.hash}}"></identicon>
{{identity.name}}
</div>
<div class="columns small-3">
<p>has {{identity.contacts}} contacts and {{identity.pubKeys}} keys.</p>
<p>{{'has {0} contacts and {1} keys.'|_:identity.contacts:identity.pubKeys}}</p>
</div>
<div class="columns small-3">
<p><b>v.{{identity.version}}</b></p>
</div>
<div class="columns small-3">
<button class="button small radius" ng-click="loadBackup(identity)">Load</button>
<button class="button small radius" ng-click="loadBackup(identity)">{{'Load'|_}}</button>
</div>
</div>
<div class="row">
<div class="columns small-3">
<button ng-show="toLoad.length>1" class="button small radius" ng-click="loadBackup();">Load All</button>
<a class="button alert small" ng-click="cancel()">Cancel</a>
<button ng-show="toLoad.length>1" class="button small radius" ng-click="loadBackup();">{{'Load all'|_}}</button>
<a class="button alert small" ng-click="cancel()">{{'Cancel'|_}}</a>
</div>
</div>
</div>
<div ng-show="step=='loaded'">
<h4>Identity loaded, load more?</h4>
<div class="row">
<div class="columns small-3">
<button class="button small radius" ng-click="step='select'">Yes</button>
<button class="button small radius" ng-click="step='select'">{{'Yes'|_}}</button>
</div>
<div class="columns small-3">
<a class="button alert small" ng-click="ok()">No</a>
<a class="button alert small" ng-click="ok()">{{'No'|_}}</a>
</div>
</div>
</div>
<div class="text-right" ng-show="!step">
<a class="button alert small radius fa fa-times" ng-click="cancel()"> Cancel</a>
<button class="button small radius glow fa fa-check" type="submit" ng-click="ok(vars.password)"> Import</button>
<a class="button alert small radius fa fa-times" ng-click="cancel()"> {{'Cancel'|_}}</a>
<button class="button small radius glow fa fa-check" type="submit" ng-click="ok(vars.password)"> {{'Import'|_}}</button>
</div>
</div>
<div class="qractions">
Expand Down
16 changes: 8 additions & 8 deletions html/modals/pick-contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

<div class="row">
<div class="small-6 columns">
<h3>Select a contact <small ng-show="vars.type=='pubKey'">Showing only contacts with public keys (pubkey or stealth addresses).</small></h3>
<h3>{{'Select a contact'|_}} <small ng-show="vars.type=='pubKey'">{{'Showing only contacts with public keys (pubkey or stealth addresses).'|_}}</small></h3>
</div>
<!-- create button -->
<div ng-show="vars.allowCreate" class="small-6 columns text-right">
<a id="newcontact" class="button tiny radius fa fa-plus topright" ng-show="!(contactFormShown===true)" ng-click="modals.focus('new-contact-name'); contactFormShown = true"> New contact</a>
<a id="newcontact" class="button tiny radius fa fa-plus topright" ng-show="!(contactFormShown===true)" ng-click="modals.focus('new-contact-name'); contactFormShown = true"> {{'New contact'|_}}</a>
</div>
</div>

<div class="row" ng-show="allContacts.length>10 && !contactFormShown">
<div class="small-12 columns">
<div class="row collapse">
<div class="small-2 columns">
<span class="prefix radius">Search</span>
<span class="prefix radius">{{'Search'|_}}</span>
</div>
<div class="small-10 columns">
<input type="text" auto-focus class="postfix radius" ng-change="filterContacts()" ng-model="contactSearch">
Expand All @@ -29,15 +29,15 @@ <h3>Select a contact <small ng-show="vars.type=='pubKey'">Showing only contacts
<div class="small-12 columns">
<div class="row collapse hide-for-small">
<div class="medium-2 columns">
<label>Name</label>
<label>{{'Name'|_}}</label>
</div>
<div class="medium-10 columns">
<label>Address</label>
<label>{{'Address'|_}}</label>
</div>
</div>
<div class="row collapse">
<div class="medium-3 columns">
<input id="new-contact-name" ng-model="vars.newContact.name" type="text" class="radius prefix" autofocus placeholder="Name for this contact..." required />
<input id="new-contact-name" ng-model="vars.newContact.name" type="text" class="radius prefix" autofocus placeholder="{{'Name for this contact...'|_}}" required />
</div>
<div class="medium-9 columns">
<input ng-model="vars.newContact.address" class="disabled prefix" type="text" btc-address />
Expand All @@ -48,8 +48,8 @@ <h3>Select a contact <small ng-show="vars.type=='pubKey'">Showing only contacts
</div>
<div class="row text-right">
<div class="small-12 columns">
<a href="" ng-click="modals.focus('contact-search'); contactFormShown = false" class="button alert small radius">Cancel</a>
<input ng-disabled="createContactForm.$invalid" type="submit" class="button small radius" value="Save" />
<a href="" ng-click="modals.focus('contact-search'); contactFormShown = false" class="button alert small radius">{{'Cancel'|_}}</a>
<input ng-disabled="createContactForm.$invalid" type="submit" class="button small radius" value="{{'Save'|_}}" />
</div>
</div>
</form>
Expand Down
2 changes: 1 addition & 1 deletion html/modals/scan-qr.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row text-center">
<h3>Scan QR code</h3>
<h3>{{'Scan QR code'|_}}</h3>
<qr-scanner width="720" height="550" ng-success="ok(data)" ng-video-error="onError(error)" />
</div>
<div class="qractions">
Expand Down
4 changes: 2 additions & 2 deletions html/notifications/mixer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You have a pending mixer transaction<br>
<small>State is {{task.store.state}}, join for {{task.store.myamount|currencyPresenter}}</small>
{{'You have a pending mixer transaction':_}}<br>
<small>{{'State is {0}, join for {1}'|_:task.store.state:(task.store.myamount|currencyPresenter)}}</small>
<progressbar value="task.store.progress">{{task.store.progress}}%</progressbar>
6 changes: 3 additions & 3 deletions html/notifications/multisig-invite.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
You have been invited to the "{{task.store.name}}" multisig fund<br>
<small>Address: {{task.store.fund.address}} Participants: {{task.store.fund.m}}/{{task.store.fund.pubKeys.length}}</small>
<a ng-click="acceptFund(task)" class='button small'>Accept</a>
{{'You have been invited to the "{0}" multisig fund'|_:task.store.name}}<br>
<small>{{'Address'|_}}: {{task.store.fund.address}} {{'Participants'|_}}: {{task.store.fund.m}}/{{task.store.fund.pubKeys.length}}</small>
<a ng-click="acceptFund(task)" class='button small'>{{'Accept'|_}}</a>
10 changes: 5 additions & 5 deletions html/notifications/multisig.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
You have a spend approval request on the {{task.fund.name}} multisig fund<br>
<small>{{task.fund.m-task.nSigs}} out of {{task.fund.participants.length}} signatures still needed</small>
<small ng-show="task.canSign && task.signed"><br />You have already signed this transaction</small>
<small ng-show="task.canSign && !task.signed"><br />You need to sign this transaction</small>
<a ng-show="task.canSign && !task.signed" ng-click="signTask(task)" class='button small'>Sign</a>
{{'You have a spend approval request on the {0} multisig fund'|_:task.fund.name}}<br>
<small>{{'{0} out of {1} signatures still needed'|_:task.fund.m-task.nSigs:task.fund.participants.length}}</small>
<small ng-show="task.canSign && task.signed"><br />{{'You have already signed this transaction'|_}}</small>
<small ng-show="task.canSign && !task.signed"><br />{{'You need to sign this transaction'|_}}</small>
<a ng-show="task.canSign && !task.signed" ng-click="signTask(task)" class='button small'>{{'Sign'|_}}</a>
6 changes: 3 additions & 3 deletions html/notifications/receive.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Receiving transaction<br>
<div><small>{{task.store.value|currencyPresenter}} ({{task.store.confirmations}} confirmations)</small></div>
<div><small>From: <b>{{task.store.recipients[0].address}}</b> To: <b ng-show="task.outPocket">{{task.outPocket.name}}</b></small></div>
{{'Receiving transaction'|_}}<br>
<div><small>{{task.store.value|currencyPresenter}} ({{'{0} confirmations'|_:task.store.confirmations}})</small></div>
<div><small>{{'From'|_}}: <b>{{task.store.recipients[0].address}}</b> {{'To'|_}}: <b ng-show="task.outPocket">{{task.outPocket.name}}</b></small></div>
<progressbar value="task.store.progress">{{task.store.progress}}%</progressbar>
4 changes: 2 additions & 2 deletions html/notifications/send.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Sending transaction ({{-task.store.value|currencyPresenter}})<br>
<small>{{task.store.address}} ({{task.store.confirmations}} confirmations)</small>
{{'Sending transaction'|_}} ({{-task.store.value|currencyPresenter}})<br>
<small>{{task.store.address}} ({{'{0} confirmations'|_:task.store.confirmations}})</small>
<progressbar value="task.store.progress">{{task.store.progress}}%</progressbar>
9 changes: 4 additions & 5 deletions html/partials/bitid.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<form class="bitid" ng-submit="login()" novalidate>
<div class="row">
<div class="small-12 columns">
<h3>Request for identification</h3>
<h3>{{'Request for identification'|_}}</h3>
</div>
</div>
<div class="row">
<div class="small-12 columns">
<div class="row collapse">
<strong>{{site}}</strong> is requesting that you identify yourself with a Bitcoin address. Do you want to proceed?
<div class="row collapse" ng-bind-html="('**{0}** is requesting that you identify yourself with a Bitcoin address. Do you want to proceed?'|_:site)">
</div>
<div class="row collapse">
<button class="button small radius">Yes</button>
<a ng-click="close()" class="button small alert radius">No</a>
<button class="button small radius">{{'Yes'|_}}</button>
<a ng-click="close()" class="button small alert radius">{{'No'|_}}</a>
</div>
</div>
</div>
Expand Down

0 comments on commit 739cbf1

Please sign in to comment.