32 lines
741 B
JavaScript
32 lines
741 B
JavaScript
// The Lucia project.
|
|
// Copyright 2023-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// chiayin.kuo@dsp.im (chiayin), 2023/1/31
|
|
// imacat.yang@dsp.im (imacat), 2023/9/23
|
|
// cindy.chang@dsp.im (Cindy Chang), 2024/5/30
|
|
/**
|
|
* @module i18n Internationalization configuration using i18next
|
|
* with browser language detection.
|
|
*/
|
|
|
|
import i18next from 'i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
import enLocale from './en.json';
|
|
|
|
|
|
i18next
|
|
.use(LanguageDetector)
|
|
.init({
|
|
resources: {
|
|
en: {
|
|
translation: enLocale
|
|
},
|
|
},
|
|
fallbackLng: 'en',
|
|
detection: {
|
|
order: ['localStorage', 'navigator'],
|
|
caches: ['localStorage']
|
|
},
|
|
});
|
|
|
|
export default i18next; |