aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/keychains/hd/restore-vault.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-22 08:41:47 +0800
committerDan <danjm.com@gmail.com>2018-03-22 08:41:47 +0800
commitd24a0590d363dbe88d383c8faec8eb28809242f0 (patch)
tree189e54ca9ea117804c96afa551cfca8158f36974 /ui/app/keychains/hd/restore-vault.js
parent29cc2f8ab9628d21cc32962666879c71be4e69d1 (diff)
downloadtangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.gz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.bz2
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.lz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.xz
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.tar.zst
tangerine-wallet-browser-d24a0590d363dbe88d383c8faec8eb28809242f0.zip
i18n redux solution doesn't require importing t() and passing state to each t() call; t is just available on props.
Diffstat (limited to 'ui/app/keychains/hd/restore-vault.js')
-rw-r--r--ui/app/keychains/hd/restore-vault.js25
1 files changed, 12 insertions, 13 deletions
diff --git a/ui/app/keychains/hd/restore-vault.js b/ui/app/keychains/hd/restore-vault.js
index 164cf28dc..f47a2641a 100644
--- a/ui/app/keychains/hd/restore-vault.js
+++ b/ui/app/keychains/hd/restore-vault.js
@@ -2,7 +2,6 @@ const inherits = require('util').inherits
const PersistentForm = require('../../../lib/persistent-form')
const connect = require('../../metamask-connect')
const h = require('react-hyperscript')
-const t = require('../../../i18n')
const actions = require('../../actions')
module.exports = connect(mapStateToProps)(RestoreVaultScreen)
@@ -37,23 +36,23 @@ RestoreVaultScreen.prototype.render = function () {
padding: 6,
},
}, [
- t('restoreVault'),
+ this.props.t('restoreVault'),
]),
// wallet seed entry
- h('h3', t('walletSeed')),
+ h('h3', this.props.t('walletSeed')),
h('textarea.twelve-word-phrase.letter-spacey', {
dataset: {
persistentFormId: 'wallet-seed',
},
- placeholder: t('secretPhrase'),
+ placeholder: this.props.t('secretPhrase'),
}),
// password
h('input.large-input.letter-spacey', {
type: 'password',
id: 'password-box',
- placeholder: t('newPassword8Chars'),
+ placeholder: this.props.t('newPassword8Chars'),
dataset: {
persistentFormId: 'password',
},
@@ -67,7 +66,7 @@ RestoreVaultScreen.prototype.render = function () {
h('input.large-input.letter-spacey', {
type: 'password',
id: 'password-box-confirm',
- placeholder: t('confirmPassword'),
+ placeholder: this.props.t('confirmPassword'),
onKeyPress: this.createOnEnter.bind(this),
dataset: {
persistentFormId: 'password-confirmation',
@@ -97,7 +96,7 @@ RestoreVaultScreen.prototype.render = function () {
style: {
textTransform: 'uppercase',
},
- }, t('cancel')),
+ }, this.props.t('cancel')),
// submit
h('button.primary', {
@@ -105,7 +104,7 @@ RestoreVaultScreen.prototype.render = function () {
style: {
textTransform: 'uppercase',
},
- }, t('ok')),
+ }, this.props.t('ok')),
]),
])
)
@@ -136,13 +135,13 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () {
var passwordConfirmBox = document.getElementById('password-box-confirm')
var passwordConfirm = passwordConfirmBox.value
if (password.length < 8) {
- this.warning = t('passwordNotLongEnough')
+ this.warning = this.props.t('passwordNotLongEnough')
this.props.dispatch(actions.displayWarning(this.warning))
return
}
if (password !== passwordConfirm) {
- this.warning = t('passwordsDontMatch')
+ this.warning = this.props.t('passwordsDontMatch')
this.props.dispatch(actions.displayWarning(this.warning))
return
}
@@ -152,18 +151,18 @@ RestoreVaultScreen.prototype.createNewVaultAndRestore = function () {
// true if the string has more than a space between words.
if (seed.split(' ').length > 1) {
- this.warning = t('spaceBetween')
+ this.warning = this.props.t('spaceBetween')
this.props.dispatch(actions.displayWarning(this.warning))
return
}
// true if seed contains a character that is not between a-z or a space
if (!seed.match(/^[a-z ]+$/)) {
- this.warning = t('loweCaseWords')
+ this.warning = this.props.t('loweCaseWords')
this.props.dispatch(actions.displayWarning(this.warning))
return
}
if (seed.split(' ').length !== 12) {
- this.warning = t('seedPhraseReq')
+ this.warning = this.props.t('seedPhraseReq')
this.props.dispatch(actions.displayWarning(this.warning))
return
}