I am trying to use the lib https://github.com/AlexanderZaytsev/react-native-i18n
It works, but a warning
react-native-i18n module is not correctly linked
still show up.
I installed it with npm install react-native-i18n --save
Versions
react-native-cli: 2.0.1
react-native: 0.55.4
npm: 5.6.0
Code
Above App.js
:
import I18n from 'react-native-i18n';
I18n.locale = I18n.currentLocale();
I18n.fallbacks = true;
I18n.translations = {en: {GENERAL: {NAME: 'example'}}};
In render:
render(){
return (
<View>
<Text>{I18n.t('GENERAL.NAME')}</Text>
</View>
);
}
I already looked at these, but I couldn't find an answer:
- react-native-i18n module linking with expo
- https://github.com/AlexanderZaytsev/react-native-i18n/issues/177
I tested using an android phone (xiaomi redmi note 5, Expo app).
Thanks for any help.
react-native-link react-native-i18n
? – reisdev