chore: 项目基线(基于 WeKnora 定制版,整理文件忽略规则)
This commit is contained in:
commit
9097ee699d
5769 files changed
+1446466
No files matched your search
@@ -0,0 +1,39 @@
|
||||
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'
|
||||
import jaJP from './locales/ja-JP.ts'
|
||||
import zhTW from './locales/zh-TW.ts'
|
||||
import { BUILT_IN_DEFAULT, resolveDefaultLocale } from './resolveDefaultLocale.ts'
|
||||
import { pluralRules } from './pluralizationRules.ts'
|
||||
|
||||
const messages = {
|
||||
'zh-CN': zhCN,
|
||||
'zh-TW': zhTW,
|
||||
'en-US': enUS,
|
||||
'ru-RU': ruRU,
|
||||
'ko-KR': koKR,
|
||||
'ja-JP': jaJP
|
||||
}
|
||||
|
||||
// User's explicit past choice wins; otherwise use the deployment default.
|
||||
const savedLocale = localStorage.getItem('locale') || resolveDefaultLocale(
|
||||
window.__RUNTIME_CONFIG__?.DEFAULT_LOCALE,
|
||||
import.meta.env.VITE_DEFAULT_LOCALE,
|
||||
)
|
||||
|
||||
const i18n = createI18n({
|
||||
legacy: false,
|
||||
locale: savedLocale,
|
||||
fallbackLocale: BUILT_IN_DEFAULT,
|
||||
globalInjection: true,
|
||||
pluralRules,
|
||||
// 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
|
||||
Reference in new issue
Block a user