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/metamask-connect.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ui/app/metamask-connect.js') diff --git a/ui/app/metamask-connect.js b/ui/app/metamask-connect.js index d13f8e87e..38fc05930 100644 --- a/ui/app/metamask-connect.js +++ b/ui/app/metamask-connect.js @@ -1,4 +1,5 @@ const connect = require('react-redux').connect +const t = require('../i18n-helper').getMessage const metamaskConnect = (mapStateToProps, mapDispatchToProps) => { return connect( @@ -12,7 +13,8 @@ const _higherOrderMapStateToProps = (mapStateToProps) => { const stateProps = mapStateToProps ? mapStateToProps(state, ownProps) : ownProps - stateProps.localeMessages = state.localeMessages || {} + console.log(`state.localeMessages`, state.localeMessages); + stateProps.t = t.bind(null, state.localeMessages) return stateProps } } -- cgit