mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? _Briefly describe what this PR aims to solve. Include background context that will help reviewers understand the purpose of the PR._ ### Type of change - [X] New Feature (non-breaking change which adds functionality)
37 lines
872 B
TypeScript
37 lines
872 B
TypeScript
import i18n from 'i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
import { initReactI18next } from 'react-i18next';
|
|
|
|
import translation_en from './en';
|
|
import translation_es from './es';
|
|
import translation_id from './id';
|
|
import translation_vi from './vi';
|
|
import translation_zh from './zh';
|
|
import translation_zh_traditional from './zh-traditional';
|
|
|
|
const resources = {
|
|
en: translation_en,
|
|
zh: translation_zh,
|
|
'zh-TRADITIONAL': translation_zh_traditional,
|
|
id: translation_id,
|
|
es: translation_es,
|
|
vi: translation_vi,
|
|
};
|
|
|
|
i18n
|
|
.use(initReactI18next)
|
|
.use(LanguageDetector)
|
|
.init({
|
|
detection: {
|
|
lookupLocalStorage: 'lng',
|
|
},
|
|
supportedLngs: ['en', 'zh', 'zh-TRADITIONAL', 'id', 'es', 'vi'],
|
|
resources,
|
|
fallbackLng: 'en',
|
|
interpolation: {
|
|
escapeValue: false,
|
|
},
|
|
});
|
|
|
|
export default i18n;
|