aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/settings.js
diff options
context:
space:
mode:
authorDan <danjm.com@gmail.com>2018-03-16 08:29:45 +0800
committerDan <danjm.com@gmail.com>2018-03-16 08:29:45 +0800
commit5fe0be722b6514692a68e920ee8058c5d572237d (patch)
tree58da5c62f17cbd0160d24e44918aa34b4ee23300 /ui/app/settings.js
parenteb5a84975b490664aa6238be6ceab3d4749167ee (diff)
downloadtangerine-wallet-browser-5fe0be722b6514692a68e920ee8058c5d572237d.tar.gz
tangerine-wallet-browser-5fe0be722b6514692a68e920ee8058c5d572237d.tar.zst
tangerine-wallet-browser-5fe0be722b6514692a68e920ee8058c5d572237d.zip
Handle i18n with redux.
Diffstat (limited to 'ui/app/settings.js')
-rw-r--r--ui/app/settings.js17
1 files changed, 10 insertions, 7 deletions
diff --git a/ui/app/settings.js b/ui/app/settings.js
index 95b69e46e..708d11082 100644
--- a/ui/app/settings.js
+++ b/ui/app/settings.js
@@ -112,9 +112,9 @@ class Settings extends Component {
}
renderCurrentLocale () {
- const { setCurrentLocale } = this.props
- const currentLocaleName = global.translator.localeName
- const currentLocale = locales.find(locale => locale.code === currentLocaleName)
+ const { updateCurrentLocale, currentLocale } = this.props
+ // const currentLocaleName = global.translator.localeName
+ // const currentLocale = locales.find(locale => locale.code === currentLocaleName)
return h('div.settings__content-row', [
h('div.settings__content-item', [
@@ -126,11 +126,12 @@ class Settings extends Component {
h(SimpleDropdown, {
placeholder: 'Select Locale',
options: getLocaleOptions(),
- selectedOption: currentLocaleName,
+ selectedOption: currentLocale,
onSelect: async (newLocale) => {
- log('set new locale', newLocale)
- await global.translator.setLocale(newLocale)
- log('did set new locale', newLocale)
+ // log('set new locale', newLocale)
+ // await global.translator.setLocale(newLocale)
+ updateCurrentLocale(newLocale)
+ // log('did set new locale', newLocale)
},
}),
]),
@@ -468,6 +469,7 @@ const mapStateToProps = state => {
metamask: state.metamask,
warning: state.appState.warning,
isMascara: state.metamask.isMascara,
+ currentLocale: state.metamask.currentLocale,
}
}
@@ -479,6 +481,7 @@ const mapDispatchToProps = dispatch => {
displayWarning: warning => dispatch(actions.displayWarning(warning)),
revealSeedConfirmation: () => dispatch(actions.revealSeedConfirmation()),
setUseBlockie: value => dispatch(actions.setUseBlockie(value)),
+ updateCurrentLocale: key => dispatch(actions.updateCurrentLocale(key)),
setFeatureFlagToBeta: () => {
return dispatch(actions.setFeatureFlag('betaUI', false, 'OLD_UI_NOTIFICATION_MODAL'))
.then(() => dispatch(actions.setNetworkEndpoints(OLD_UI_NETWORK_TYPE)))