Skip to content
Merged
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 .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ TZ=Asia/Shanghai
# 系统默认语言(BCP-47),用于 Prompt 中 {{language}} 占位符回退。
# 优先级:Accept-Language 请求头 > 此变量 > 内置默认值 (en-US)。
# WEKNORA_LANGUAGE=zh-CN
# 前端界面默认语言(BCP-47)。可选:zh-CN | en-US | ru-RU | ko-KR | ja-JP。
# 前端界面默认语言(BCP-47)。可选:zh-CN | zh-TW | en-US | ru-RU | ko-KR | ja-JP。
# 优先级:用户已选语言(localStorage) > 此变量 > 内置默认 zh-CN。
# 仅影响首次访问/未手动切换语言的用户;改完重启 frontend 容器即生效,无需重建镜像。
# DEFAULT_LOCALE=en-US
Expand Down
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|zh-TW|en-US|ru-RU|ko-KR|ja-JP) RUNTIME_DEFAULT_LOCALE="${DEFAULT_LOCALE}" ;;
esac

# 生成运行时配置文件,注入环境变量到前端
Expand Down
2 changes: 1 addition & 1 deletion frontend/public/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ window.__RUNTIME_CONFIG__ = {
MAX_SKILL_BUNDLE_SIZE_MB: 256,
// Optional: serve embed on a dedicated origin, e.g. 'https://embed.example.com'
EMBED_BASE_URL: '',
// Optional: default UI locale for first-time visitors (zh-CN | en-US | ru-RU | ko-KR | ja-JP)
// Optional: default UI locale for first-time visitors (zh-CN | zh-TW | en-US | ru-RU | ko-KR | ja-JP)
DEFAULT_LOCALE: '',
};
2 changes: 1 addition & 1 deletion frontend/public/weknora-widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* WeKnora.openWithQuery('How do I reset my password?')
* Opens the panel (if closed) and sends the query when the iframe is ready.
* WeKnora.setLocale('en-US')
* Switch embed UI language (zh-CN | en-US | ko-KR | ja-JP | ru-RU).
* Switch embed UI language (zh-CN | zh-TW | en-US | ko-KR | ja-JP | ru-RU).
*
* Secure mode (recommended): instead of `token`, pass `tokenEndpoint` — a URL on
* your own backend that returns { token: "ems_...", expiresIn: 1800 }. Your
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import zhCNConfig from 'tdesign-vue-next/esm/locale/zh_CN'
import koKRConfig from 'tdesign-vue-next/esm/locale/ko_KR'
import jaJPConfig from 'tdesign-vue-next/esm/locale/ja_JP'
import ruRUConfig from 'tdesign-vue-next/esm/locale/ru_RU'
import zhTWConfig from 'tdesign-vue-next/esm/locale/zh_TW'

const { locale, t, tm } = useI18n()
const { formatRole, roleIcon } = useRoleLabel()
Expand All @@ -30,6 +31,7 @@ const settingsStore = useSettingsStore()
const tdLocaleMap: Record<string, object> = {
'en-US': enUSConfig,
'zh-CN': zhCNConfig,
'zh-TW': zhTWConfig,
'ko-KR': koKRConfig,
'ja-JP': jaJPConfig,
'ru-RU': ruRUConfig,
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' | 'zh-TW' | 'en-US' | 'ko-KR' | 'ja-JP' | 'ru-RU';
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' | 'zh-TW' | 'en-US' | 'ko-KR' | 'ja-JP' | 'ru-RU' | ''

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 @@ -538,6 +538,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: 'ja-JP' },
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 @@ -684,6 +684,7 @@ const platformOptions = computed(() => ([
const localeOptions = computed(() => ([
{ value: '' as IMLocale, label: t('agentEditor.im.replyLanguageDefault') },
{ value: 'zh-CN' as IMLocale, label: '简体中文' },
{ value: 'zh-TW' as IMLocale, label: '繁體中文' },
{ value: 'en-US' as IMLocale, label: 'English' },
{ value: 'ja-JP' as IMLocale, label: '日本語' },
{ value: 'ko-KR' as IMLocale, label: '한국어' },
Expand Down
Loading
Loading