Skip to content

Instantly share code, notes, and snippets.

@jazmon
Last active March 15, 2017 21:47
Show Gist options
  • Save jazmon/ee0271822f0d1e9ce32e5c4859acf5db to your computer and use it in GitHub Desktop.
Save jazmon/ee0271822f0d1e9ce32e5c4859acf5db to your computer and use it in GitHub Desktop.
React Native i18n
import i18n from 'i18next';
import i18nextReactNative from 'i18next-react-native-language-detector';
// Path to your translation bundle
import translation from '../translation.json';
i18n
.use(i18nextReactNative) // set to use the React Native locale detector
.init({ // look up these properties in the i18next documentation
fallbackLng: 'en',
debug: false,
ns: [
'common',
],
defaultNS: 'common',
fallbackNS: 'common',
resources: translation, // Here you pass the translation bundle
interpolation: {
escapeValue: false,
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment