APSL / redux-i18n

A simple and powerful package for translate your react applications using react-redux.
MIT License
233 stars 52 forks source link

Translated strings don't rerender when new translations are set #135

Closed JosephBrooksbank closed 2 years ago

JosephBrooksbank commented 3 years ago

In our app, we set the header of the page in many places like so:

componentDidMount() {
     this.props.setTitle(this.context.t( $key_of_name )
}

The issue we are running into is that our translations file is now hosted elsewhere, gotten only after the client has received which language the user wants the page in. When new translations are set with setTranslations, these strings do not rerender.

Changing lang DOES cause a rerender, thus A temporary solution I've found is to setLanguage("not_a_real_locale") before getting the translations, and then setting it back to the real language afterwards. This is not ideal.

JosephBrooksbank commented 2 years ago

fixed in 1.5.19; issue occured in 1.5.18.