From d24a0590d363dbe88d383c8faec8eb28809242f0 Mon Sep 17 00:00:00 2001 From: Dan Date: Wed, 21 Mar 2018 22:11:47 -0230 Subject: i18n redux solution doesn't require importing t() and passing state to each t() call; t is just available on props. --- ui/app/components/signature-request.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'ui/app/components/signature-request.js') diff --git a/ui/app/components/signature-request.js b/ui/app/components/signature-request.js index 7f4493b66..a1ed049f7 100644 --- a/ui/app/components/signature-request.js +++ b/ui/app/components/signature-request.js @@ -9,7 +9,6 @@ const classnames = require('classnames') const AccountDropdownMini = require('./dropdowns/account-dropdown-mini') const actions = require('../actions') -const t = require('../../i18n-helper').getMessage const { conversionUtil } = require('../conversion-util') const { @@ -55,7 +54,7 @@ SignatureRequest.prototype.renderHeader = function () { h('div.request-signature__header-background'), - h('div.request-signature__header__text', t(this.props.localeMessages, 'sigRequest')), + h('div.request-signature__header__text', this.props.t('sigRequest')), h('div.request-signature__header__tip-container', [ h('div.request-signature__header__tip'), @@ -76,7 +75,7 @@ SignatureRequest.prototype.renderAccountDropdown = function () { return h('div.request-signature__account', [ - h('div.request-signature__account-text', [t(this.props.localeMessages, 'account') + ':']), + h('div.request-signature__account-text', [this.props.t('account') + ':']), h(AccountDropdownMini, { selectedAccount, @@ -103,7 +102,7 @@ SignatureRequest.prototype.renderBalance = function () { return h('div.request-signature__balance', [ - h('div.request-signature__balance-text', [t(this.props.localeMessages, 'balance')]), + h('div.request-signature__balance-text', [this.props.t('balance')]), h('div.request-signature__balance-value', `${balanceInEther} ETH`), @@ -137,7 +136,7 @@ SignatureRequest.prototype.renderRequestInfo = function () { return h('div.request-signature__request-info', [ h('div.request-signature__headline', [ - t(this.props.localeMessages, 'yourSigRequested'), + this.props.t('yourSigRequested'), ]), ]) @@ -155,18 +154,18 @@ SignatureRequest.prototype.msgHexToText = function (hex) { SignatureRequest.prototype.renderBody = function () { let rows - let notice = t(this.props.localeMessages, 'youSign') + ':' + let notice = this.props.t('youSign') + ':' const { txData } = this.props const { type, msgParams: { data } } = txData if (type === 'personal_sign') { - rows = [{ name: t(this.props.localeMessages, 'message'), value: this.msgHexToText(data) }] + rows = [{ name: this.props.t('message'), value: this.msgHexToText(data) }] } else if (type === 'eth_signTypedData') { rows = data } else if (type === 'eth_sign') { - rows = [{ name: t(this.props.localeMessages, 'message'), value: data }] - notice = t(this.props.localeMessages, 'signNotice') + rows = [{ name: this.props.t('message'), value: data }] + notice = this.props.t('signNotice') } return h('div.request-signature__body', {}, [ @@ -225,10 +224,10 @@ SignatureRequest.prototype.renderFooter = function () { return h('div.request-signature__footer', [ h('button.request-signature__footer__cancel-button', { onClick: cancel, - }, t(this.props.localeMessages, 'cancel')), + }, this.props.t('cancel')), h('button.request-signature__footer__sign-button', { onClick: sign, - }, t(this.props.localeMessages, 'sign')), + }, this.props.t('sign')), ]) } -- cgit