Closed Jeremboo closed 6 years ago
Hi, Thanks for the pull request, but this doesnt fix the issue. constructor
will be called everytime a new locale is set, but it will always set locale to the this.props.locale
. Locale switching wont work anymore.
To set the initial locale, you have to use initialState value in createStore
https://github.com/rmdort/react-redux-multilingual/blob/master/example/index.js#L11
Either this or use store.dispatch(setLocale('zh'))
Cheers Vinay
Indeed, set the local value into the initalState in the createStore is most relevant !
It could be nice to update the README.md and the example folder with this method.
@rmdort have you the time to do that ?
Its already in the Readme 👍
https://github.com/rmdort/react-redux-multilingual#setting-the-initial-locale
locale="en" really troubled me... I'm apologize ! And thanks a lot !
Could you also update the Readme to remove the locale="en"
and update (or remove) the Translate using context part please ? It could be troubling some guys like me haha.
Hi, I encoutered the same error as the issue #9 ! Set the
local
property doesn't change the language by default.It comes because
local
is overwrited by the default state.So I fix it with this pull request !