Changing language in react native app using react native i18n not working

Viewed 1785

I am trying to change language of my app in run time when user selects the language. I am trying to do like this

import I18n from 'react-native-i18n'

onChangeLanguage = () => {
    console.log('String before change : >>> ', I18n.t('welcome'))
    I18n.locale = 'hi'
    console.log('String after change : >>> ', I18n.t('welcome'))
}

In Both logs I got same string . I took reference from here. In this reference there is an example with redux but My use case is with mobx. If the language is changed how to re render component to reflect the language changes.

0 Answers
Related