Last active
March 20, 2017 17:33
-
-
Save jazmon/bae0bce120afb88118c7de54494ced38 to your computer and use it in GitHub Desktop.
React Native i18n -- MyComponent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { | |
Text, | |
View, | |
} from 'react-native'; | |
// Import i18next to get it's translation feature | |
import i18n from 'i18next'; | |
const MyComponent = () => ( | |
<View> | |
<Text>{i18n.t('common:welcome')}</Text> | |
</View> | |
); | |
export default MyComponent; | |
// assuming english locale, it's same as | |
/* | |
<View> | |
<Text>Welcome to the app!</Text> | |
</View> | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment