mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-17 09:56:06 +00:00
56c686cd5a
* feat: add Japanese (ja-JP) language support - Add comprehensive Japanese translation file (ja-JP.ts) - Update i18n configuration to include Japanese locale - Add Japanese language option to login and register page dropdowns - Implement Japanese language detection and switching logic - Maintain fallback to en-US for missing translations in flexible components Co-Authored-By: Junyan Qin <Chin>, 秦骏言 in Chinese, you can call me my english name Rock Chin. <rockchinq@gmail.com> * perf: ui for ja-JP --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Junyan Qin <Chin>, 秦骏言 in Chinese, you can call me my english name Rock Chin. <rockchinq@gmail.com>
39 lines
863 B
TypeScript
39 lines
863 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';
|
|
import jaJP from './locales/ja-JP';
|
|
|
|
i18n
|
|
.use(LanguageDetector)
|
|
.use(initReactI18next)
|
|
.init({
|
|
resources: {
|
|
'en-US': {
|
|
translation: enUS,
|
|
},
|
|
'zh-Hans': {
|
|
translation: zhHans,
|
|
},
|
|
'ja-JP': {
|
|
translation: jaJP,
|
|
},
|
|
},
|
|
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;
|