James Prado 816ce3180f Translation Updates (#1323)
* Update account view routing

* Temporarily add unicode character to translated strings for testing

* Temporarily select add unicode to all untranslated strings

* Format changes

* Add all english translations for /account & /generate

* Add the rest of the english translations

* Add a few more missing translations

* Update en translations

* Get selectedLanguage from localstorage instead of redux sttate

* Update snapshots

* Add missing translation keys & Update translate functs & change variable prefix

* translate all markdown strings & remove old translation strings

* Update snapshot

* Add a few more translation strs

* Move raw strings being translated into json

* All translation keys are now Uppercase

* Fix up the last few translations

* Update snapshot

* Uppercase de translation strings

* Bring back shapeshift logo on swap

* Fix contracts tab translations

* Fix a few more translations

* Fix translations

* remove debugging stuff

* Update snapshots

* Use react.fragment as markdown root renderer

* Seperate markdown translations into their own function

* Clean up translation functions

* Clean up translation functions

* Update snapshot

* Fix some broken translation strings

* Add prettier ignore file
2018-03-21 22:50:25 -05:00

69 lines
2.0 KiB
TypeScript

import { IV3Wallet } from 'ethereumjs-wallet';
import React, { Component } from 'react';
import translate, { translateRaw } from 'translations';
import { makeBlob } from 'utils/blob';
import './DownloadWallet.scss';
import Template from '../Template';
interface Props {
keystore: IV3Wallet;
filename: string;
continue(): void;
}
interface State {
hasDownloadedWallet: boolean;
}
export default class DownloadWallet extends Component<Props, State> {
public state: State = {
hasDownloadedWallet: false
};
public render() {
const { filename } = this.props;
const { hasDownloadedWallet } = this.state;
return (
<Template>
<div className="DlWallet">
<h1 className="DlWallet-title">{translate('GEN_LABEL_2')}</h1>
<a
role="button"
className="DlWallet-download btn btn-primary btn-lg"
aria-label="Download Keystore File (UTC / JSON · Recommended · Encrypted)"
aria-describedby={translateRaw('X_KEYSTOREDESC')}
download={filename}
href={this.getBlob()}
onClick={this.handleDownloadKeystore}
>
{translate('ACTION_13', { $thing: translateRaw('X_KEYSTORE2') })}
</a>
<div className="DlWallet-warning">
<p>{translate('DL_WALLET_WARNING_1')}</p>
<p>{translate('DL_WALLET_WARNING_2')}</p>
<p>{translate('DL_WALLET_WARNING_3')}</p>
</div>
<button
className="DlWallet-continue btn btn-danger"
role="button"
onClick={this.handleContinue}
disabled={!hasDownloadedWallet}
>
{translate('ACTION_14')}
</button>
</div>
</Template>
);
}
public getBlob = () => makeBlob('text/json;charset=UTF-8', this.props.keystore);
private handleContinue = () => this.state.hasDownloadedWallet && this.props.continue();
private handleDownloadKeystore = () => this.setState({ hasDownloadedWallet: true });
}