Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { renderWorkspaceNotifyContent } from '@/utils/workspaceNotifyContent'
// TDesign locale configs
import enUSConfig from 'tdesign-vue-next/esm/locale/en_US'
import zhCNConfig from 'tdesign-vue-next/esm/locale/zh_CN'
import zhTWConfig from 'tdesign-vue-next/esm/locale/zh_TW'
import koKRConfig from 'tdesign-vue-next/esm/locale/ko_KR'
import ruRUConfig from 'tdesign-vue-next/esm/locale/ru_RU'

Expand All @@ -28,6 +29,7 @@ const settingsStore = useSettingsStore()
const tdLocaleMap: Record<string, object> = {
'en-US': enUSConfig,
'zh-CN': zhCNConfig,
'zh-TW': zhTWConfig,
'ko-KR': koKRConfig,
'ru-RU': ruRUConfig,
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/AgentEmbedChannelPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ const headerTitleModeOptions = computed(() => ([
const defaultLocaleOptions = computed(() => ([
{ label: t('embedPublish.defaultLocaleBrowser'), value: '' },
{ label: '简体中文', value: 'zh-CN' },
{ label: '繁體中文', value: 'zh-TW' },
{ label: 'English', value: 'en-US' },
{ label: '한국어', value: 'ko-KR' },
{ label: 'Русский', value: 'ru-RU' },
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/i18n/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,7 @@ const ruEmbedPublish = {
},
} as const

const SUPPORTED_LOCALES = ['zh-CN', 'en-US', 'ko-KR', 'ru-RU'] as const
const SUPPORTED_LOCALES = ['zh-CN', 'zh-TW', 'en-US', 'ko-KR', 'ru-RU'] as const
export type EmbedLocale = (typeof SUPPORTED_LOCALES)[number]

/** Isolated from the main app `locale` key so embed preview never hijacks admin UI language. */
Expand All @@ -1214,6 +1214,7 @@ export function normalizeEmbedLocale(raw: string): EmbedLocale {
if (s.startsWith('en')) return 'en-US'
if (s.startsWith('ko')) return 'ko-KR'
if (s.startsWith('ru')) return 'ru-RU'
if (s === 'zh-tw' || s === 'zh-hant') return 'zh-TW'
if (s.startsWith('zh')) return 'zh-CN'
const exact = SUPPORTED_LOCALES.find((l) => l.toLowerCase() === s)
return exact || 'zh-CN'
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { createI18n } from 'vue-i18n'
import zhCN from './locales/zh-CN.ts'
import zhTW from './locales/zh-TW.ts'
import ruRU from './locales/ru-RU.ts'
import enUS from './locales/en-US.ts'
import koKR from './locales/ko-KR.ts'
import { BUILT_IN_DEFAULT, resolveDefaultLocale } from './resolveDefaultLocale.ts'

const messages = {
'zh-CN': zhCN,
'zh-TW': zhTW,
'en-US': enUS,
'ru-RU': ruRU,
'ko-KR': koKR
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/i18n/localeKeyAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,12 @@ import enUS from './locales/en-US.ts'
import koKR from './locales/ko-KR.ts'
import ruRU from './locales/ru-RU.ts'
import zhCN from './locales/zh-CN.ts'
import zhTW from './locales/zh-TW.ts'

export const LOCALE_BUNDLES = {
'en-US': enUS,
'zh-CN': zhCN,
'zh-TW': zhTW,
'ko-KR': koKR,
'ru-RU': ruRU,
} as const
Expand Down Expand Up @@ -512,7 +514,7 @@ export function findAllLocaleMessageCompileErrors(

type LocaleTree = Record<string, unknown>

const LOCALE_ORDER: LocaleName[] = ['en-US', 'zh-CN', 'ko-KR', 'ru-RU']
const LOCALE_ORDER: LocaleName[] = ['en-US', 'zh-CN', 'zh-TW', 'ko-KR', 'ru-RU']
const LOCALES_DIR = join(dirname(fileURLToPath(import.meta.url)), 'locales')

function getLocaleValueAtPathParts(current: unknown, parts: string[]): unknown {
Expand Down
Loading
Loading