forked from bitpay/bitpay-app
-
Notifications
You must be signed in to change notification settings - Fork 0
/
i18n.js
31 lines (27 loc) · 742 Bytes
/
i18n.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import i18n from 'i18next';
import {initReactI18next} from 'react-i18next';
import * as RNLocalize from 'react-native-localize';
import * as translationEN from './locales/en/translation.json';
import * as translationES from './locales/es/translation.json';
const detectedLanguage = RNLocalize.getLocales()[0].languageCode;
const resources = {
en: {
translation: translationEN,
},
es: {
translation: translationES,
},
};
i18n
.use(initReactI18next) // passes i18n down to react-i18next
.init({
resources,
compatibilityJSON: 'v3',
lng: detectedLanguage,
fallbackLng: 'en',
debug: false,
interpolation: {
escapeValue: false, // react already safes from xss
},
});
export default i18n;