Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import i18n from 'react-native-i18n'
- import Exponent from 'exponent'
- import es from '../locales/es'
- import en from '../locales/en'
- i18n.fallbacks = true
- const getLanguage = async () => {
- i18n.locale = (await Exponent.Util.getCurrentLocaleAsync()).substring(0,2)
- }
- getLanguage()
- i18n.translations = {
- 'es': es,
- 'en': en,
- }
- export default i18n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement