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: 1 addition & 1 deletion frontend/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Only emit whitelisted locale tags to avoid config.js injection from env values.
RUNTIME_DEFAULT_LOCALE=""
case "${DEFAULT_LOCALE:-}" in
zh-CN|en-US|ru-RU|ko-KR|ja-JP) RUNTIME_DEFAULT_LOCALE="${DEFAULT_LOCALE}" ;;
zh-CN|en-US|vi-VN|ru-RU|ko-KR|ja-JP) RUNTIME_DEFAULT_LOCALE="${DEFAULT_LOCALE}" ;;
esac

# 生成运行时配置文件,注入环境变量到前端
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/agent/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ export interface IMChannel {
enabled: boolean;
mode: 'webhook' | 'websocket' | 'longpoll';
output_mode: 'stream' | 'full';
locale?: '' | 'zh-CN' | 'en-US' | 'ko-KR' | 'ja-JP' | 'ru-RU';
locale?: '' | 'zh-CN' | 'en-US' | 'ko-KR' | 'ja-JP' | 'ru-RU' | 'vi-VN';
session_mode?: 'user' | 'thread';
knowledge_base_id?: string;
credentials: Record<string, any>;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/api/embed/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface EmbedChannelPublicConfig {
default_locale?: string
}

export type EmbedLocaleTag = 'zh-CN' | 'en-US' | 'ko-KR' | 'ja-JP' | 'ru-RU' | ''
export type EmbedLocaleTag = 'zh-CN' | 'en-US' | 'ko-KR' | 'ja-JP' | 'ru-RU' | 'vi-VN' | ''

export interface EmbedChannelStats {
session_count: number
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 @@ -539,6 +539,7 @@ const defaultLocaleOptions = computed(() => ([
{ label: t('embedPublish.defaultLocaleBrowser'), value: '' },
{ label: '简体中文', value: 'zh-CN' },
{ label: 'English', value: 'en-US' },
{ label: 'Tiếng Việt', value: 'vi-VN' },
{ label: '한국어', value: 'ko-KR' },
{ label: '日本語', value: 'ja-JP' },
{ label: 'Русский', value: 'ru-RU' },
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/IMChannelPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,7 @@ const localeOptions = computed(() => ([
{ value: '' as IMLocale, label: t('agentEditor.im.replyLanguageDefault') },
{ value: 'zh-CN' as IMLocale, label: '简体中文' },
{ value: 'en-US' as IMLocale, label: 'English' },
{ value: 'vi-VN' as IMLocale, label: 'Tiếng Việt' },
{ value: 'ja-JP' as IMLocale, label: '日本語' },
{ value: 'ko-KR' as IMLocale, label: '한국어' },
{ value: 'ru-RU' as IMLocale, label: 'Русский' },
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/i18n/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2062,7 +2062,7 @@ const ruEmbedPublish = {
},
} as const

export const SUPPORTED_LOCALES = ['zh-CN', 'en-US', 'ko-KR', 'ja-JP', 'ru-RU'] as const
export const SUPPORTED_LOCALES = ['zh-CN', 'en-US', 'ko-KR', 'ja-JP', 'ru-RU', 'vi-VN'] 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 @@ -2076,6 +2076,7 @@ export function normalizeEmbedLocale(raw: string): EmbedLocale {
if (s.startsWith('ja')) return 'ja-JP'
if (s.startsWith('ru')) return 'ru-RU'
if (s.startsWith('zh')) return 'zh-CN'
if (s.startsWith('vi')) return 'vi-VN'
const exact = SUPPORTED_LOCALES.find((l) => l.toLowerCase() === s)
return exact || 'zh-CN'
}
Expand Down Expand Up @@ -2114,6 +2115,7 @@ export const EMBED_MESSAGES = {
'ko-KR': deepMerge(messages['en-US'], koEmbedPublish),
'ja-JP': messages['ja-JP'],
'ru-RU': deepMerge(messages['en-US'], ruEmbedPublish),
'vi-VN': messages['en-US'],
} as const

const i18n = createI18n({
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ 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 viVN from './locales/vi-VN.ts'
import { BUILT_IN_DEFAULT, resolveDefaultLocale } from './resolveDefaultLocale.ts'

const messages = {
'zh-CN': zhCN,
'en-US': enUS,
'ru-RU': ruRU,
'ko-KR': koKR,
'ja-JP': jaJP
'ja-JP': jaJP,
'vi-VN': viVN
}

// User's explicit past choice wins; otherwise use the deployment default.
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/localeKeyAudit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ test('prune rebuild restores registered audit keys from baked-in English default
const emptyBundles = {
'en-US': {},
'zh-CN': {},
'vi-VN': {},
'ko-KR': {},
'ja-JP': {},
'ru-RU': {},
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 @@ -21,10 +21,12 @@ import jaJP from './locales/ja-JP.ts'
import koKR from './locales/ko-KR.ts'
import ruRU from './locales/ru-RU.ts'
import zhCN from './locales/zh-CN.ts'
import viVN from './locales/vi-VN.ts'

export const LOCALE_BUNDLES = {
'en-US': enUS,
'zh-CN': zhCN,
'vi-VN': viVN,
'ko-KR': koKR,
'ja-JP': jaJP,
'ru-RU': ruRU,
Expand Down Expand Up @@ -527,7 +529,7 @@ export function findAllLocaleMessageCompileErrors(

type LocaleTree = Record<string, unknown>

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

function getLocaleValueAtPathParts(current: unknown, parts: string[]): unknown {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/i18n/locales/en-US.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5121,6 +5121,7 @@ export default {
language: {
zhCN: '简体中文',
enUS: 'English',
viVN: 'Tiếng Việt',
ruRU: 'Русский',
koKR: '한국어',
jaJP: '日本語',
Expand Down
Loading