Translation: Address book (#503)

* translation address book

* fix lint

* 2-link
This commit is contained in:
Tobias 2021-11-29 21:06:07 +01:00 committed by GitHub
commit e35353c608
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 125 additions and 66 deletions

View file

@ -385,7 +385,7 @@
</ng-template> </ng-template>
</ng-template> </ng-template>
<td class="amount-column uk-text-middle uk-text-muted" [title]="('Incoming Transaction') + ( (pending.amountRaw && (pending.amountRaw > 0) ) ? ( ', +' + ( pending.amountRaw.toString(10) ) + ' raw' ) : '' )"> <td class="amount-column uk-text-middle uk-text-muted" [title]="('Incoming Transaction') + ( (pending.amountRaw && (pending.amountRaw > 0) ) ? ( ', +' + ( pending.amountRaw.toString(10) ) + ' raw' ) : '' )">
<span class="uk-text-small">{{ 'general.actions.ready-to-receive' | transloco }}</span><br> <span class="uk-text-small">{{ 'general.blockactions.ready-to-receive' | transloco }}</span><br>
<span class="amount-integer">{{ pending.amount | rai: 'mnano,true' | amountsplit: 0 }}</span> <span class="amount-integer">{{ pending.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>
<span class="amount-fractional">{{ pending.amount | rai: 'mnano,true' | amountsplit: 1 }}</span> <span class="amount-fractional">{{ pending.amount | rai: 'mnano,true' | amountsplit: 1 }}</span>
<span class="currency-name">XNO</span> <span class="currency-name">XNO</span>
@ -457,7 +457,7 @@
[title]="( (history.confirmed === false) ? ('account-details.this-change-has-not-yet-been-confirmed-by-the-network' | transloco) : '' )" [title]="( (history.confirmed === false) ? ('account-details.this-change-has-not-yet-been-confirmed-by-the-network' | transloco) : '' )"
uk-tooltip uk-tooltip
> >
{{ 'general.actions.rep-change' | transloco }} {{ 'general.blockactions.rep-change' | transloco }}
<span class="icon-unconfirmed" uk-icon="icon: clock;" *ngIf="(history.confirmed === false)"></span> <span class="icon-unconfirmed" uk-icon="icon: clock;" *ngIf="(history.confirmed === false)"></span>
</span> </span>
</span> </span>
@ -468,7 +468,7 @@
[title]="( (history.confirmed === false) ? ('account-details.this-transaction-has-not-yet-been-confirmed-by-the-network' | transloco) : '' )" [title]="( (history.confirmed === false) ? ('account-details.this-transaction-has-not-yet-been-confirmed-by-the-network' | transloco) : '' )"
uk-tooltip uk-tooltip
> >
{{ 'general.actions.received' | transloco }} {{ 'general.blockactions.received' | transloco }}
<span class="icon-unconfirmed" uk-icon="icon: clock;" *ngIf="(history.confirmed === false)"></span> <span class="icon-unconfirmed" uk-icon="icon: clock;" *ngIf="(history.confirmed === false)"></span>
</span><br> </span><br>
</ng-container> </ng-container>
@ -478,7 +478,7 @@
[title]="( (history.confirmed === false) ? ('account-details.this-transaction-has-not-yet-been-confirmed-by-the-network' | transloco) : '' )" [title]="( (history.confirmed === false) ? ('account-details.this-transaction-has-not-yet-been-confirmed-by-the-network' | transloco) : '' )"
uk-tooltip uk-tooltip
> >
{{ 'general.actions.sent' | transloco }} {{ 'general.blockactions.sent' | transloco }}
<span class="icon-unconfirmed" uk-icon="icon: clock;" *ngIf="(history.confirmed === false)"></span> <span class="icon-unconfirmed" uk-icon="icon: clock;" *ngIf="(history.confirmed === false)"></span>
</span><br> </span><br>
</ng-container> </ng-container>

View file

@ -1,26 +1,26 @@
<div class="uk-animation-slide-left-small" uk-grid> <div class="uk-animation-slide-left-small" uk-grid *transloco="let t">
<div class="uk-width-1-1" id="address-book-sortable"> <div class="uk-width-1-1" id="address-book-sortable">
<div class="uk-margin-bottom" uk-grid> <div class="uk-margin-bottom" uk-grid>
<div class="uk-width-expand@s uk-width-1-1"> <div class="uk-width-expand@s uk-width-1-1">
<h2 class="uk-heading-divider uk-text-truncate"> <h2 class="uk-heading-divider uk-text-truncate">
Address Book {{ 'general.address-book' | transloco }}
<a *ngIf="activePanel !== 1" (click)="activePanel = activePanel === 0 ? 2 : 0; addressBookShowFileExport = false;" style="font-size: 12px; margin-left: 25px;">{{ activePanel === 2 ? 'BACK TO ADDRESS BOOK' : 'IMPORT / EXPORT' }}</a> <a *ngIf="activePanel !== 1" (click)="activePanel = activePanel === 0 ? 2 : 0; addressBookShowFileExport = false;" style="font-size: 12px; margin-left: 25px;">{{ activePanel === 2 ? ('address-book.back-to-address-book' | transloco | uppercase) : ('address-book.import-export' | transloco | uppercase) }}</a>
</h2> </h2>
</div> </div>
<div class="uk-width-auto@s uk-width-1-1 uk-text-right"> <div class="uk-width-auto@s uk-width-1-1 uk-text-right">
<button class="uk-button uk-button-secondary uk-align-right uk-width-auto@s" (click)="addEntry()" *ngIf="activePanel === 0">Add New Entry</button> <button class="uk-button uk-button-secondary uk-align-right uk-width-auto@s" (click)="addEntry()" *ngIf="activePanel === 0">{{ 'address-book.add-new-entry' | transloco }}</button>
</div> </div>
</div> </div>
<div class="uk-width-1-1 nlt-page-intro" *ngIf="activePanel === 0"> <div class="uk-width-1-1 nlt-page-intro" *ngIf="activePanel === 0">
<p> <p>
You can use the address book to store a label for your own accounts or for easy access to other addresses throughout the application.<br> {{ 'address-book.you-can-use-the-address-book-to-store.1' | transloco }}<br>
It's also possible to track the balance and/or transactions of any address, known as "watch-only".<br> {{ 'address-book.you-can-use-the-address-book-to-store.2' | transloco }}
</p> </p>
<div class="account-amounts-primary uk-width-1-1"> <div class="account-amounts-primary uk-width-1-1">
<div class="details-header advanced-options-link" (click)="showAdvancedOptions = !showAdvancedOptions"> <div class="details-header advanced-options-link" (click)="showAdvancedOptions = !showAdvancedOptions">
Show Total Tracked Balance {{ 'address-book.show-total-tracked-balance' | transloco }}
<div [class]="['chevron', ( showAdvancedOptions ? 'chevron-up' : 'chevron-down' )]"></div> <div [class]="['chevron', ( showAdvancedOptions ? 'chevron-up' : 'chevron-down' )]"></div>
</div> </div>
@ -31,7 +31,7 @@
<span class="currency-name">XNO</span> <span class="currency-name">XNO</span>
</span> </span>
<div *ngIf="totalTrackedPending.gt(0)" class="incoming-label"> <div *ngIf="totalTrackedPending.gt(0)" class="incoming-label">
<div class="text-snippet">New</div> <div class="text-snippet">{{ 'general.new' | transloco }}</div>
<div class="text-full">+{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 0 }}{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 1 }} XNO</div> <div class="text-full">+{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 0 }}{{ totalTrackedPending | rai: 'mnano,true' | amountsplit: 1 }} XNO</div>
</div> </div>
<div class="account-amounts-converted uk-width-1-1 text-half-muted"> <div class="account-amounts-converted uk-width-1-1 text-half-muted">
@ -48,10 +48,10 @@
<ul class="uk-list uk-list-striped" style="margin-bottom: 0;"> <ul class="uk-list uk-list-striped" style="margin-bottom: 0;">
<li class="uk-list-header"> <li class="uk-list-header">
<div uk-grid> <div uk-grid>
<div class="uk-width-2-5">Name</div> <div class="uk-width-2-5">{{ 'general.name' | transloco }}</div>
<div class="uk-width-expand">Address <div class="uk-width-expand">{{ 'general.address' | transloco }}
<div *ngIf="numberOfTrackedBalance > 0" style="display: flex;"> <div *ngIf="numberOfTrackedBalance > 0" style="display: flex;">
RELOAD BALANCES {{ 'address-book.reload-balances' | transloco | uppercase }}
<ul class="uk-width-auto uk-iconnav uk-margin-remove-left" style="margin-top: -1px;"> <ul class="uk-width-auto uk-iconnav uk-margin-remove-left" style="margin-top: -1px;">
<li> <li>
<div <div
@ -74,7 +74,7 @@
</ul> </ul>
</div> </div>
</div> </div>
<div class="uk-width-1-6 uk-text-center" style="padding-left: 0;">Actions</div> <div class="uk-width-1-6 uk-text-center" style="padding-left: 0;">{{ 'general.actions' | transloco }}</div>
</div> </div>
</li> </li>
</ul> </ul>
@ -96,12 +96,12 @@
<div class="uk-width-expand uk-text-truncate uk-visible-toggle"> <div class="uk-width-expand uk-text-truncate uk-visible-toggle">
<div uk-grid> <div uk-grid>
<div class="uk-width-expand uk-text-truncate"> <div class="uk-width-expand uk-text-truncate">
<a [routerLink]="'/account/' + addressBook.account" class="nano-address-clickable nano-address-monospace uk-display-block" title="View on Network Explorer" uk-tooltip> <a [routerLink]="'/account/' + addressBook.account" class="nano-address-clickable nano-address-monospace uk-display-block" [title]="t('general.view-on-network-explorer')" uk-tooltip>
<app-nano-account-id [accountID]="addressBook.account"></app-nano-account-id> <app-nano-account-id [accountID]="addressBook.account"></app-nano-account-id>
</a> </a>
</div> </div>
<ul class="nano-address-actions uk-iconnav"> <ul class="nano-address-actions uk-iconnav">
<li><a ngxClipboard [cbContent]="addressBook.account" (cbOnSuccess)="copied()" uk-icon="icon: copy" title="Copy Address" uk-tooltip></a></li> <li><a ngxClipboard [cbContent]="addressBook.account" (cbOnSuccess)="copied()" uk-icon="icon: copy" [title]="t('general.copy-to-clipboard')" uk-tooltip></a></li>
</ul> </ul>
<div class="uk-width-expand amount-container" *ngIf="addressBook.trackBalance"> <div class="uk-width-expand amount-container" *ngIf="addressBook.trackBalance">
<ng-container *ngIf="(walletService.wallet.updatingBalance === false) else balanceLoading"> <ng-container *ngIf="(walletService.wallet.updatingBalance === false) else balanceLoading">
@ -135,7 +135,7 @@
</li> </li>
<li *ngIf="!(addressBook$ | async).length" class="uk-text-center"> <li *ngIf="!(addressBook$ | async).length" class="uk-text-center">
You do not have any address book entries saved yet, <a (click)="addEntry()">click here to create one</a>. {{ 'address-book.you-do-not-have-any-address-book-entries-saved-yet.1' | transloco }} <a (click)="addEntry()">{{ 'address-book.you-do-not-have-any-address-book-entries-saved-yet.2-link' | transloco }}</a>{{ 'address-book.you-do-not-have-any-address-book-entries-saved-yet.3' | transloco }}
</li> </li>
</ul> </ul>
@ -147,36 +147,36 @@
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<div class="uk-card uk-card-default"> <div class="uk-card uk-card-default">
<div class="uk-card-header"> <div class="uk-card-header">
<h2 class="uk-card-title">{{ creatingNewEntry ? 'Add New Entry' : 'Edit Entry' }}</h2> <h2 class="uk-card-title">{{ creatingNewEntry ? ( 'address-book.add-new-entry' | transloco ) : ( 'address-book.edit-entry' | transloco ) }}</h2>
</div> </div>
<div class="uk-card-body"> <div class="uk-card-body">
<div class="uk-form-horizontal"> <div class="uk-form-horizontal">
<div class="uk-margin"> <div class="uk-margin">
<label class="uk-form-label" for="new-address-name">Name</label> <label class="uk-form-label" for="new-address-name">{{ 'general.name' | transloco }}</label>
<div class="uk-form-controls"> <div class="uk-form-controls">
<input type="text" class="uk-input" id="new-address-name" [(ngModel)]="newAddressName" (keyup.enter)="saveNewAddress()" placeholder="Exchange Deposit Address, Main Trading Account, etc" maxlength="64"> <input type="text" class="uk-input" id="new-address-name" [(ngModel)]="newAddressName" (keyup.enter)="saveNewAddress()" [placeholder]="t('address-book.exchange-deposit-address-main-trading-account-etc')" maxlength="64">
</div> </div>
</div> </div>
<div class="uk-margin"> <div class="uk-margin">
<label class="uk-form-label" for="new-address-account">Address</label> <label class="uk-form-label" for="new-address-account">{{ 'general.address' | transloco }}</label>
<div class="uk-form-controls"> <div class="uk-form-controls">
<div class="uk-inline uk-width-1-1"> <div class="uk-inline uk-width-1-1">
<a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('account1','account')" uk-tooltip title="Scan from QR code" *ngIf="creatingNewEntry"></a> <a class="uk-form-icon uk-form-icon-flip" uk-icon="icon: camera" (click)="openQR('account1','account')" uk-tooltip [title]="t('general.scan-qr-code')" *ngIf="creatingNewEntry"></a>
<input type="text" class="uk-input" id="new-address-account" [(ngModel)]="newAddressAccount" [disabled]="!creatingNewEntry" placeholder="nano_abc123"> <input type="text" class="uk-input" id="new-address-account" [(ngModel)]="newAddressAccount" [disabled]="!creatingNewEntry" placeholder="nano_abc123">
</div> </div>
</div> </div>
</div> </div>
<div class="uk-margin"> <div class="uk-margin">
<label class="uk-form-label" for="new-track-balance">Track Balance <span uk-icon="icon: info;" uk-tooltip title="The balance will be displayed in the address book."></span></label> <label class="uk-form-label" for="new-track-balance">{{ 'address-book.track-balance' | transloco }} <span uk-icon="icon: info;" uk-tooltip [title]="t('address-book.the-balance-will-be-displayed-in-the-address-book')"></span></label>
<div class="uk-form-controls"> <div class="uk-form-controls">
<input class="uk-checkbox checkbox-aligned" type="checkbox" id="new-track-balance" value="1" [(ngModel)]="newTrackBalance"> <input class="uk-checkbox checkbox-aligned" type="checkbox" id="new-track-balance" value="1" [(ngModel)]="newTrackBalance">
</div> </div>
</div> </div>
<div class="uk-margin"> <div class="uk-margin">
<label class="uk-form-label" for="new-track-transactions">Track Transactions <span uk-icon="icon: info;" uk-tooltip title="A notification will be shown whenever the address has a new incoming transaction, sends or receives funds, or changes its representative."></span></label> <label class="uk-form-label" for="new-track-transactions">{{ 'address-book.track-transactions' | transloco }} <span uk-icon="icon: info;" uk-tooltip [title]="t('address-book.a-notification-will-be-shown-whenever-the-address-has-a-new')"></span></label>
<div class="uk-form-controls"> <div class="uk-form-controls">
<input class="uk-checkbox checkbox-aligned" type="checkbox" id="new-track-transactions" value="1" [(ngModel)]="newTrackTransactions"> <input class="uk-checkbox checkbox-aligned" type="checkbox" id="new-track-transactions" value="1" [(ngModel)]="newTrackTransactions">
</div> </div>
@ -184,8 +184,8 @@
</div> </div>
</div> </div>
<div class="uk-card-footer uk-text-right@s nlt-button-group"> <div class="uk-card-footer uk-text-right@s nlt-button-group">
<button class="uk-button uk-button-danger" (click)="cancelNewAddress()">Cancel</button> <button class="uk-button uk-button-danger" (click)="cancelNewAddress()">{{ 'general.cancel' | transloco }}</button>
<button class="uk-button uk-button-primary" (click)="saveNewAddress()">Save</button> <button class="uk-button uk-button-primary" (click)="saveNewAddress()">{{ 'general.save' | transloco }}</button>
</div> </div>
</div> </div>
</div> </div>
@ -195,15 +195,15 @@
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<div class="uk-card uk-card-default"> <div class="uk-card uk-card-default">
<div class="uk-card-header"> <div class="uk-card-header">
<h3 class="uk-card-title">Address Book Import</h3> <h3 class="uk-card-title">{{ 'address-book.address-book-import' | transloco }}</h3>
</div> </div>
<div class="uk-card-body"> <div class="uk-card-body">
<p>Import address book entries from a file.</p> <p>{{ 'address-book.import-address-book-entries-from-a-file' | transloco }}</p>
</div> </div>
<div class="uk-card-footer uk-text-right@s uk-text-center nlt-button-group"> <div class="uk-card-footer uk-text-right@s uk-text-center nlt-button-group">
<div class="js-upload uk-text-left uk-width-auto@s uk-width-1-1" style="display: inline-block;" uk-form-custom> <div class="js-upload uk-text-left uk-width-auto@s uk-width-1-1" style="display: inline-block;" uk-form-custom>
<input type="file" id="import-from-file" (change)="importFromFile($event.target.files)" multiple> <input type="file" id="import-from-file" (change)="importFromFile($event.target.files)" multiple>
<button class="uk-button uk-button-primary uk-width-auto@s uk-width-1-1" type="button" tabindex="-1">Import Address Book</button> <button class="uk-button uk-button-primary uk-width-auto@s uk-width-1-1" type="button" tabindex="-1">{{ 'address-book.import-address-book' | transloco }}</button>
</div> </div>
</div> </div>
</div> </div>
@ -211,10 +211,11 @@
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<div class="uk-card uk-card-default"> <div class="uk-card uk-card-default">
<div class="uk-card-header"> <div class="uk-card-header">
<h3 class="uk-card-title">Address Book Export</h3> <h3 class="uk-card-title">{{ 'address-book.address-book-export' | transloco }}</h3>
</div> </div>
<div class="uk-card-body"> <div class="uk-card-body">
<p>Export all address book entries to a file or QR Code/URL.<br><br>Note: Exported address book will NOT be encrypted by your wallet password.</p> <p>{{ 'address-book.export-all-address-book-entries-to-a-file-or-qr-code-url' | transloco }}</p>
<p>{{ 'address-book.note-exported-address-book-will-not-be-encrypted-by-your-wal' | transloco }}</p>
<div *ngIf="addressBookShowFileExport" uk-grid> <div *ngIf="addressBookShowFileExport" uk-grid>
<div class="uk-width-1-1"> <div class="uk-width-1-1">
<hr class="uk-divider-icon"> <hr class="uk-divider-icon">
@ -222,23 +223,23 @@
<div class="uk-width-1-1@s uk-width-1-2@m uk-width-1-3@l"> <div class="uk-width-1-1@s uk-width-1-2@m uk-width-1-3@l">
<img *ngIf="addressBookShowQRExport" [src]="addressBookQRExportImg" alt="QR code" style="border-radius: 6px;"> <img *ngIf="addressBookShowQRExport" [src]="addressBookQRExportImg" alt="QR code" style="border-radius: 6px;">
<span *ngIf="!addressBookShowQRExport" class="uk-text-warning">Address book too large for a QR code.<br>If you need a QR,<br>use fewer entries or shorter aliases.<br></span> <span *ngIf="!addressBookShowQRExport" class="uk-text-warning">{{ 'address-book.address-book-too-large-for-a-qr-code' | transloco }}<br>{{ 'address-book.if-you-need-a-qr-use-fewer-entries-or-shorter-aliases' | transloco }}</span>
</div> </div>
<div class="uk-width-1-1@s uk-width-1-2@m uk-width-2-3@l"> <div class="uk-width-1-1@s uk-width-1-2@m uk-width-2-3@l">
<span *ngIf="addressBookShowQRExport">Scan the QR code on any device to import your address book!<br><br></span> <span *ngIf="addressBookShowQRExport">{{ 'address-book.scan-the-qr-code-on-any-device-to-import-your-address-book' | transloco }}<br><br></span>
<span *ngIf="addressBookShowQRExport">You can also import your address book by using the URL below or download it as a file.</span> <span *ngIf="addressBookShowQRExport">{{ 'address-book.you-can-also-import-your-address-book-by-using-the-url-below' | transloco }}</span>
<span *ngIf="!addressBookShowQRExport">You can still import your address book by using the URL below or download it as a file.</span> <span *ngIf="!addressBookShowQRExport">{{ 'address-book.you-can-still-import-your-address-book-by-using-the-url' | transloco }}</span>
<br><br> <br><br>
<input type="text" class="uk-input" style="max-width: 750px;" value="{{ addressBookQRExportUrl }}"><br> <input type="text" class="uk-input" style="max-width: 750px;" value="{{ addressBookQRExportUrl }}"><br>
<div class="nlt-button-group uk-margin-small-top"> <div class="nlt-button-group uk-margin-small-top">
<button ngxClipboard [cbContent]="addressBookQRExportUrl" (cbOnSuccess)="notificationService.sendSuccess('Address book export copied to clipboard!')" class="uk-button uk-button-secondary" style="margin-left: 0;">Copy To Clipboard</button> <button ngxClipboard [cbContent]="addressBookQRExportUrl" (cbOnSuccess)="notificationService.sendSuccess('Address book export copied to clipboard!')" class="uk-button uk-button-secondary" style="margin-left: 0;">{{ 'general.copy-to-clipboard' | transloco }}</button>
<button (click)="exportAddressBookToFile()" class="uk-button uk-button-primary">Export As File</button> <button (click)="exportAddressBookToFile()" class="uk-button uk-button-primary">{{ 'address-book.export-as-file' | transloco }}</button>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<div *ngIf="!addressBookShowFileExport" class="uk-card-footer uk-text-right@s uk-text-center nlt-button-group"> <div *ngIf="!addressBookShowFileExport" class="uk-card-footer uk-text-right@s uk-text-center nlt-button-group">
<button (click)="exportAddressBook()" class="uk-button uk-button-primary uk-width-auto@s uk-width-1-1">Export Address Book</button> <button (click)="exportAddressBook()" class="uk-button uk-button-primary uk-width-auto@s uk-width-1-1">{{ 'address-book.export-address-book' | transloco }}</button>
</div> </div>
</div> </div>
</div> </div>

View file

@ -129,7 +129,7 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
const datas = result.map(el => el.dataset.account); const datas = result.map(el => el.dataset.account);
this.addressBookService.setAddressBookOrder(datas); this.addressBookService.setAddressBookOrder(datas);
this.notificationService.sendSuccess(`Updated address book order`); this.notificationService.sendSuccess(this.translocoService.translate('address-book.updated-address-book-order'));
}); });
} }
@ -266,11 +266,11 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
async saveNewAddress() { async saveNewAddress() {
if (!this.newAddressAccount || !this.newAddressName) { if (!this.newAddressAccount || !this.newAddressName) {
return this.notificationService.sendError(`Account and name are required`); return this.notificationService.sendError(this.translocoService.translate('address-book.account-and-name-are-required'));
} }
if (this.newTrackBalance && this.numberOfTrackedBalance >= 20) { if (this.newTrackBalance && this.numberOfTrackedBalance >= 20) {
return this.notificationService.sendError(`You can only track the balance of maximum 20 addresses`); return this.notificationService.sendError(this.translocoService.translate('address-book.you-can-only-track-the-balance-of-maximum-20-addresses'));
} }
// Trim and remove duplicate spaces // Trim and remove duplicate spaces
@ -278,7 +278,7 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
const regexp = new RegExp('^(Account|' + this.translocoService.translate('general.account') + ') #\\d+$', 'g'); const regexp = new RegExp('^(Account|' + this.translocoService.translate('general.account') + ') #\\d+$', 'g');
if ( regexp.test(this.newAddressName) === true ) { if ( regexp.test(this.newAddressName) === true ) {
return this.notificationService.sendError(`This name is reserved for wallet accounts without a label`); return this.notificationService.sendError(this.translocoService.translate('address-book.this-name-is-reserved-for-wallet-accounts-without-a-label'));
} }
// Remove spaces and convert to nano prefix // Remove spaces and convert to nano prefix
@ -286,12 +286,16 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
// If the name has been changed, make sure no other entries are using that name // If the name has been changed, make sure no other entries are using that name
if ( (this.newAddressName !== this.previousAddressName) && this.addressBookService.nameExists(this.newAddressName) ) { if ( (this.newAddressName !== this.previousAddressName) && this.addressBookService.nameExists(this.newAddressName) ) {
return this.notificationService.sendError(`This name is already in use! Please use a unique name`); return this.notificationService.sendError(this.translocoService.translate('address-book.this-name-is-already-in-use-please-use-a-unique-name'));
} }
// Make sure the address is valid // Make sure the address is valid
const valid = this.util.account.isValidAccount(this.newAddressAccount); const valid = this.util.account.isValidAccount(this.newAddressAccount);
if (!valid) return this.notificationService.sendWarning(`Account ID is not a valid account`); if (!valid) {
return this.notificationService.sendWarning(
this.translocoService.translate('address-book.account-id-is-not-a-valid-account')
);
}
// Store old setting // Store old setting
const wasTransactionTracked = this.addressBookService.getTransactionTrackingById(this.newAddressAccount); const wasTransactionTracked = this.addressBookService.getTransactionTrackingById(this.newAddressAccount);
@ -299,7 +303,7 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
try { try {
await this.addressBookService.saveAddress(this.newAddressAccount, await this.addressBookService.saveAddress(this.newAddressAccount,
this.newAddressName, this.newTrackBalance, this.newTrackTransactions); this.newAddressName, this.newTrackBalance, this.newTrackTransactions);
this.notificationService.sendSuccess(`Address book entry saved successfully!`); this.notificationService.sendSuccess(this.translocoService.translate('address-book.address-book-entry-saved-successfully'));
// If this is one of our accounts, set its name and let it propagate through the app // If this is one of our accounts, set its name and let it propagate through the app
const walletAccount = this.walletService.wallet.accounts.find(a => a.id === this.newAddressAccount); const walletAccount = this.walletService.wallet.accounts.find(a => a.id === this.newAddressAccount);
if (walletAccount) { if (walletAccount) {
@ -317,7 +321,7 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
this.updateTrackedBalances(); this.updateTrackedBalances();
this.cancelNewAddress(); this.cancelNewAddress();
} catch (err) { } catch (err) {
this.notificationService.sendError(`Unable to save entry: ${err.message}`); this.notificationService.sendError(this.translocoService.translate('address-book.unable-to-save-entry', { message: err.message }));
} }
} }
@ -329,17 +333,17 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
copied() { copied() {
this.notificationService.removeNotification('success-copied'); this.notificationService.removeNotification('success-copied');
this.notificationService.sendSuccess(`Account address copied to clipboard!`, { identifier: 'success-copied' }); this.notificationService.sendSuccess(this.translocoService.translate('address-book.account-address-copied-to-clipboard'), { identifier: 'success-copied' });
} }
async deleteAddress(account) { async deleteAddress(account) {
try { try {
this.addressBookService.deleteAddress(account); this.addressBookService.deleteAddress(account);
this.notificationService.sendSuccess(`Successfully deleted address book entry`); this.notificationService.sendSuccess(this.translocoService.translate('address-book.successfully-deleted-address-book-entry'));
this.walletService.untrackAddress(account); this.walletService.untrackAddress(account);
this.updateTrackedBalances(); this.updateTrackedBalances();
} catch (err) { } catch (err) {
this.notificationService.sendError(`Unable to delete entry: ${err.message}`); this.notificationService.sendError(this.translocoService.translate('address-book.unable-to-delete-entry', { message: err.message }));
} }
} }
@ -385,7 +389,7 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
const exportData = this.addressBookService.addressBook; const exportData = this.addressBookService.addressBook;
this.triggerFileDownload(fileName, exportData); this.triggerFileDownload(fileName, exportData);
this.notificationService.sendSuccess(`Address book export downloaded!`); this.notificationService.sendSuccess(this.translocoService.translate('address-book.address-book-export-downloaded'));
} }
importFromFile(files) { importFromFile(files) {
@ -400,13 +404,13 @@ export class AddressBookComponent implements OnInit, AfterViewInit, OnDestroy {
try { try {
const importData = JSON.parse(fileData); const importData = JSON.parse(fileData);
if (!importData.length || !importData[0].account) { if (!importData.length || !importData[0].account) {
return this.notificationService.sendError(`Bad import data, make sure you selected a Nault Address Book export`); return this.notificationService.sendError(this.translocoService.translate('address-book.bad-import-data-make-sure-you-selected-a-nault-address-book'));
} }
const encoded = btoa(this.toBinary(JSON.stringify(importData))); const encoded = btoa(this.toBinary(JSON.stringify(importData)));
this.router.navigate(['import-address-book'], { fragment: encoded }); this.router.navigate(['import-address-book'], { fragment: encoded });
} catch (err) { } catch (err) {
this.notificationService.sendError(`Unable to parse import data, make sure you selected the right file!`); this.notificationService.sendError(this.translocoService.translate('address-book.unable-to-parse-import-data-make-sure-you-selected-the-right'));
} }
}; };

View file

@ -100,23 +100,23 @@
<div <div
class="action" class="action"
*ngSwitchCase="isReceivableTransaction" *ngSwitchCase="isReceivableTransaction"
>{{ 'general.actions.ready-to-receive' | transloco }}</div> >{{ 'general.blockactions.ready-to-receive' | transloco }}</div>
<div <div
class="action" class="action"
*ngSwitchCase="isRepresentativeChange" *ngSwitchCase="isRepresentativeChange"
>{{ 'general.actions.rep-change' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div> >{{ 'general.blockactions.rep-change' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div>
<div <div
class="action" class="action"
*ngSwitchCase="isSendTransaction" *ngSwitchCase="isSendTransaction"
>{{ 'general.actions.sent' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div> >{{ 'general.blockactions.sent' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div>
<div <div
class="action" class="action"
*ngSwitchCase="isReceiveTransaction" *ngSwitchCase="isReceiveTransaction"
>{{ 'general.actions.received' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div> >{{ 'general.blockactions.received' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div>
<div <div
class="action" class="action"
*ngSwitchDefault *ngSwitchDefault
>{{ 'general.actions.unknown-action' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div> >{{ 'general.blockactions.unknown-action' | transloco }}<ng-template [ngTemplateOutlet]="unconfirmedIcon"></ng-template></div>
</ng-container> </ng-container>
<div class="amount" *ngIf="isReceivableTransaction || isSendTransaction || isReceiveTransaction"> <div class="amount" *ngIf="isReceivableTransaction || isSendTransaction || isReceiveTransaction">
<span class="amount-integer">{{ transaction.amount | rai: 'mnano,true' | amountsplit: 0 }}</span> <span class="amount-integer">{{ transaction.amount | rai: 'mnano,true' | amountsplit: 0 }}</span>

View file

@ -54,6 +54,55 @@
"3": "." "3": "."
} }
}, },
"address-book": {
"a-notification-will-be-shown-whenever-the-address-has-a-new": "A notification will be shown whenever the address has a new incoming transaction, sends or receives funds, or changes its representative.",
"account-address-copied-to-clipboard": "Account address copied to clipboard!",
"account-and-name-are-required": "Account and name are required",
"account-id-is-not-a-valid-account": "Account ID is not a valid account",
"add-new-entry": "Add New Entry",
"address-book-entry-saved-successfully": "Address book entry saved successfully!",
"address-book-export": "Address Book Export",
"address-book-export-downloaded": "Address book export downloaded!",
"address-book-import": "Address Book Import",
"address-book-too-large-for-a-qr-code": "Address book too large for a QR code.",
"back-to-address-book": "Back to address book",
"bad-import-data-make-sure-you-selected-a-nault-address-book": "Bad import data, make sure you selected a Nault Address Book export",
"edit-entry": "Edit Entry",
"exchange-deposit-address-main-trading-account-etc": "Exchange Deposit Address, Main Trading Account, etc.",
"export-address-book": "Export Address Book",
"export-all-address-book-entries-to-a-file-or-qr-code-url": "Export all address book entries to a file or QR Code/URL.",
"export-as-file": "Export As File",
"if-you-need-a-qr-use-fewer-entries-or-shorter-aliases": "If you need a QR, use fewer entries or shorter aliases.",
"import-address-book": "Import Address Book",
"import-address-book-entries-from-a-file": "Import address book entries from a file.",
"import-export": "Import / Export",
"note-exported-address-book-will-not-be-encrypted-by-your-wal": "Note: Exported address book will NOT be encrypted by your wallet password.",
"reload-balances": "Reload balances",
"scan-the-qr-code-on-any-device-to-import-your-address-book": "Scan the QR code on any device to import your address book!",
"show-total-tracked-balance": "Show Total Tracked Balance",
"successfully-deleted-address-book-entry": "Successfully deleted address book entry",
"the-balance-will-be-displayed-in-the-address-book": "The balance will be displayed in the address book.",
"this-name-is-already-in-use-please-use-a-unique-name": "This name is already in use! Please use a unique name",
"this-name-is-reserved-for-wallet-accounts-without-a-label": "This name is reserved for wallet accounts without a label",
"track-balance": "Track Balance",
"track-transactions": "Track Transactions",
"unable-to-delete-entry": "Unable to delete entry: {{ message }}",
"unable-to-parse-import-data-make-sure-you-selected-the-right": "Unable to parse import data, make sure you selected the right file!",
"unable-to-save-entry": "Unable to save entry: {{ message }}",
"updated-address-book-order": "Updated address book order!",
"you-can-also-import-your-address-book-by-using-the-url-below": "You can also import your address book by using the URL below or download it as a file.",
"you-can-only-track-the-balance-of-maximum-20-addresses": "You can only track the balance of maximum 20 addresses",
"you-can-still-import-your-address-book-by-using-the-url": "You can still import your address book by using the URL below or download it as a file.",
"you-can-use-the-address-book-to-store": {
"1": "You can use the address book to store a label for your own accounts or for easy access to other addresses throughout the application.",
"2": "It's also possible to track the balance and/or transactions of any address, known as \"watch-only\"."
},
"you-do-not-have-any-address-book-entries-saved-yet": {
"1": "You do not have any address book entries saved yet,",
"2-link": "click here to create one",
"3": "."
}
},
"change-rep-widget": { "change-rep-widget": {
"acceptable-representative": "Acceptable Representative", "acceptable-representative": "Acceptable Representative",
"bad-representative": "Bad Representative", "bad-representative": "Bad Representative",
@ -242,13 +291,8 @@
"general": { "general": {
"account": "Account", "account": "Account",
"accounts": "Accounts", "accounts": "Accounts",
"actions": { "actions": "Actions",
"ready-to-receive": "Ready to receive", "address": "Address",
"received": "Received",
"rep-change": "Rep. Change",
"sent": "Sent",
"unknown-action": "Unknown Action"
},
"address-book": "Address Book", "address-book": "Address Book",
"amount": "Amount", "amount": "Amount",
"app-settings": "App Settings", "app-settings": "App Settings",
@ -256,11 +300,20 @@
"balance": "Balance", "balance": "Balance",
"block": "Block", "block": "Block",
"block-count": "Block Count", "block-count": "Block Count",
"blockactions": {
"ready-to-receive": "Ready to receive",
"received": "Received",
"rep-change": "Rep. Change",
"sent": "Sent",
"unknown-action": "Unknown Action"
},
"cancel": "Cancel", "cancel": "Cancel",
"copy": "Copy", "copy": "Copy",
"copy-to-clipboard": "Copy To Clipboard",
"date": "Date", "date": "Date",
"edit": "Edit", "edit": "Edit",
"loading": "Loading...", "loading": "Loading...",
"name": "Name",
"network": "Network", "network": "Network",
"new": "New", "new": "New",
"no": "No", "no": "No",
@ -282,6 +335,7 @@
"uncemented-blocks": "Uncemented Blocks", "uncemented-blocks": "Uncemented Blocks",
"unknown": "Unknown", "unknown": "Unknown",
"view-details": "View Details", "view-details": "View Details",
"view-on-network-explorer": "View on Network Explorer",
"yes": "Yes" "yes": "Yes"
}, },
"representative-search": { "representative-search": {