Files
Enterprise-Knowledge-Base/frontend/src/i18n/index.ts
T
2026-05-21 11:19:44 +08:00

30 lines
999 B
TypeScript
Executable File

import { createI18n } from 'vue-i18n'
import zhCN from './locales/zh-CN.ts'
import ruRU from './locales/ru-RU.ts'
import enUS from './locales/en-US.ts'
import koKR from './locales/ko-KR.ts'
const messages = {
'zh-CN': zhCN,
'en-US': enUS,
'ru-RU': ruRU,
'ko-KR': koKR
}
// Получаем сохраненный язык из localStorage или используем китайский по умолчанию
const savedLocale = localStorage.getItem('locale') || 'zh-CN'
console.log('i18n инициализация с языком:', savedLocale)
const i18n = createI18n({
legacy: false,
locale: savedLocale,
fallbackLocale: 'zh-CN',
globalInjection: true,
// Some translations intentionally embed `<strong>` markup (e.g. agent step summaries).
// We render them via v-html with our own sanitization, so silence vue-i18n's HTML warning
// to avoid flooding the console and slowing renders during history loads.
warnHtmlMessage: false,
messages
})
export default i18n