mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-08 23:06:03 +00:00
* feat: add i18n support with language selector on login page Co-Authored-By: Junyan Qin <Chin> <rockchinq@gmail.com> * feat: complete i18n implementation for all webui components Co-Authored-By: Junyan Qin <Chin> <rockchinq@gmail.com> * feat: complete all hardcoded text * feat: dynamic label i18n * fix: lint errors * fix: lint errors * delete sh fils * fix: edit model dialog title --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Junyan Qin <Chin> <rockchinq@gmail.com>
35 lines
774 B
TypeScript
35 lines
774 B
TypeScript
'use client';
|
|
|
|
import i18n from 'i18next';
|
|
import { initReactI18next } from 'react-i18next';
|
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
|
|
import enUS from './locales/en-US';
|
|
import zhHans from './locales/zh-Hans';
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources: {
|
|
'en-US': {
|
|
translation: enUS,
|
|
},
|
|
'zh-Hans': {
|
|
translation: zhHans,
|
|
},
|
|
},
|
|
fallbackLng: 'zh-Hans',
|
|
debug: process.env.NODE_ENV === 'development',
|
|
interpolation: {
|
|
escapeValue: false, // React already escapes values
|
|
},
|
|
detection: {
|
|
order: ['localStorage', 'navigator'],
|
|
lookupLocalStorage: 'langbot_language',
|
|
caches: ['localStorage'],
|
|
},
|
|
});
|
|
|
|
export default i18n;
|