rmdort / react-redux-multilingual

A simple and slim multi-lingual component for React with Redux without react-intl or react-i18n
41 stars 14 forks source link

I can't set locale='ru' by default #9

Closed JuliaPetrishina closed 6 years ago

JuliaPetrishina commented 6 years ago

I can't set locale='ru' by default. Could you help me with this?

rmdort commented 6 years ago

You can set default locale by passing locale prop to IntlProvider

<IntlProvider locale='ru'>
</IntlProvider >

Or you can dispatch an action

import { IntlActions } from 'react-redux-multilingual'

const store =createStore(....)
store.dispatch(IntlActions.setLocale('ru'))
JuliaPetrishina commented 6 years ago

@rmdort The second one helped. Thanks a lot!

rmdort commented 6 years ago

ok great. I have added this to the Readme.