Skip to content

Instantly share code, notes, and snippets.

@jazmon
Last active March 20, 2017 17:33
Show Gist options
  • Save jazmon/bae0bce120afb88118c7de54494ced38 to your computer and use it in GitHub Desktop.
Save jazmon/bae0bce120afb88118c7de54494ced38 to your computer and use it in GitHub Desktop.
React Native i18n -- MyComponent.js
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