-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathi18n.js
More file actions
36 lines (30 loc) 路 661 Bytes
/
Copy pathi18n.js
File metadata and controls
36 lines (30 loc) 路 661 Bytes
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
import i18n from 'i18next'
import { initReactI18next } from 'react-i18next'
import LanguageDetector from 'i18next-browser-languagedetector'
import en from './public/locales/en/common.json'
import tr from './public/locales/tr/common.json'
const resources = {
en: {
common: en,
},
tr: {
common: tr,
},
}
i18n
.use(LanguageDetector)
.use(initReactI18next)
.init({
resources,
fallbackLng: 'en',
defaultNS: 'common',
ns: ['common'],
interpolation: {
escapeValue: false,
},
detection: {
order: ['localStorage', 'navigator', 'htmlTag'],
caches: ['localStorage'],
},
})
export default i18n