mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-14 08:42:08 +10:00
add language detector from i18next
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import i18n from 'i18next';
|
||||
import backend from 'i18next-xhr-backend';
|
||||
import { initReactI18next } from 'react-i18next';
|
||||
import detector from 'i18next-browser-languagedetector';
|
||||
|
||||
import resources from './locales';
|
||||
|
||||
@ -46,13 +48,17 @@ const languages = [
|
||||
},
|
||||
];
|
||||
|
||||
i18n.use(initReactI18next).init({
|
||||
resources,
|
||||
lng: 'en',
|
||||
fallbackLng: 'en',
|
||||
ns: ['app', 'leftSidebar', 'rightSidebar'],
|
||||
defaultNS: 'app',
|
||||
});
|
||||
i18n
|
||||
.use(detector)
|
||||
.use(backend)
|
||||
.use(initReactI18next)
|
||||
.init({
|
||||
resources,
|
||||
lng: 'en',
|
||||
fallbackLng: 'en',
|
||||
ns: ['app', 'leftSidebar', 'rightSidebar'],
|
||||
defaultNS: 'app',
|
||||
});
|
||||
|
||||
export { languages };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user