-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtranslator.js
45 lines (43 loc) · 1006 Bytes
/
translator.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import translator from 'i18next';
import {initReactI18next} from 'react-i18next';
import {getLocales} from 'react-native-localize';
import en from './src/utils/language/en.json';
import ar from './src/utils/language/ar.json';
import es from './src/utils/language/es.json';
import fr from './src/utils/language/fr.json';
import pt from './src/utils/language/pt.json';
import ru from './src/utils/language/ru.json';
import tr from './src/utils/language/tr.json';
import zh from './src/utils/language/zh.json';
translator.use(initReactI18next).init({
compatibilityJSON: 'v3',
lng: getLocales()[0].languageCode,
fallbackLng: 'en',
resources: {
en: {
translation: en,
},
ar: {
translation: ar,
},
es: {
translation: es,
},
fr: {
translation: fr,
},
pt: {
translation: pt,
},
ru: {
translation: ru,
},
tr: {
translation: tr,
},
zh: {
translation: zh,
},
},
});
export default translator;