aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/accounts/import/json.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/accounts/import/json.js')
-rw-r--r--ui/app/accounts/import/json.js20
1 files changed, 11 insertions, 9 deletions
diff --git a/ui/app/accounts/import/json.js b/ui/app/accounts/import/json.js
index fa25168f1..326e052f2 100644
--- a/ui/app/accounts/import/json.js
+++ b/ui/app/accounts/import/json.js
@@ -1,10 +1,11 @@
const Component = require('react').Component
const PropTypes = require('prop-types')
const h = require('react-hyperscript')
-const connect = require('react-redux').connect
+const connect = require('../../metamask-connect')
const actions = require('../../actions')
const FileInput = require('react-simple-file-input').default
-const t = require('../../../i18n')
+const t = require('../../../i18n-helper').getMessage
+
const HELP_LINK = 'https://support.metamask.io/kb/article/7-importing-accounts'
@@ -24,11 +25,11 @@ class JsonImportSubview extends Component {
return (
h('div.new-account-import-form__json', [
- h('p', t('usedByClients')),
+ h('p', t(this.props.localeMessages, 'usedByClients')),
h('a.warning', {
href: HELP_LINK,
target: '_blank',
- }, t('fileImportFail')),
+ }, t(this.props.localeMessages, 'fileImportFail')),
h(FileInput, {
readAs: 'text',
@@ -43,7 +44,7 @@ class JsonImportSubview extends Component {
h('input.new-account-import-form__input-password', {
type: 'password',
- placeholder: t('enterPassword'),
+ placeholder: t(this.props.localeMessages, 'enterPassword'),
id: 'json-password-box',
onKeyPress: this.createKeyringOnEnter.bind(this),
}),
@@ -53,13 +54,13 @@ class JsonImportSubview extends Component {
h('button.new-account-create-form__button-cancel', {
onClick: () => this.props.goHome(),
}, [
- t('cancel'),
+ t(this.props.localeMessages, 'cancel'),
]),
h('button.new-account-create-form__button-create', {
onClick: () => this.createNewKeychain(),
}, [
- t('import'),
+ t(this.props.localeMessages, 'import'),
]),
]),
@@ -91,7 +92,7 @@ class JsonImportSubview extends Component {
const { fileContents } = state
if (!fileContents) {
- const message = t('needImportFile')
+ const message = t(this.props.localeMessages, 'needImportFile')
return this.props.displayWarning(message)
}
@@ -99,7 +100,7 @@ class JsonImportSubview extends Component {
const password = passwordInput.value
if (!password) {
- const message = t('needImportPassword')
+ const message = t(this.props.localeMessages, 'needImportPassword')
return this.props.displayWarning(message)
}
@@ -112,6 +113,7 @@ JsonImportSubview.propTypes = {
goHome: PropTypes.func,
displayWarning: PropTypes.func,
importNewJsonAccount: PropTypes.func,
+ localeMessages: PropTypes.object,
}
const mapStateToProps = state => {