fix: translation

This commit is contained in:
sophie committed 2026-05-22 18:54:18 +08:00
1 parent 1689347494
commit 6bc93490d4
4 files changed
+279 -14

No files matched your search

@@ -21,7 +21,7 @@ const emit = defineEmits<{
(e: 'submitted'): void;
}>();
const { t } = useI18n();
const { t, locale } = useI18n({ useScope: 'global' });
const typeOptions = computed(() => [
t('feedback.type.featureSuggestion'),
@@ -63,6 +63,12 @@ watch(
},
);
watch(locale, () => {
if (props.modelValue) {
resetForm();
}
});
const submitFeedback = async () => {
if (!canSubmit.value) {
error.value = t('feedback.msg.fillContent');
+254
View File
@@ -1103,6 +1103,10 @@ const messages = {
voiceFeature: 'Voice feature',
collapseBrowser: 'Collapse Browser',
openBrowser: 'Open Browser',
kb: {
enterprise: 'Enterprise Knowledge Base',
erp: 'ERP Knowledge Base'
},
browser: 'Browser',
closeBrowser: 'Close Browser',
browserInputPlaceholder: 'Enter URL, e.g. https://example.com',
@@ -1226,12 +1230,21 @@ const messages = {
profile: {
title: 'Profile',
personalInfo: 'Personal Information',
basicInfo: 'Basic Information',
department: 'Department',
language: 'Language',
username: 'Username',
employeeId: 'Employee ID',
realName: 'Real Name',
email: 'Email',
phoneNumber: 'Phone Number',
theme: 'Theme',
roleAdmin: 'Administrator',
roleUser: 'User',
unsavedChanges: 'You have unsaved changes',
editHint: 'Switch to edit mode to update profile details',
switchEditHint: 'Switch to edit mode to update profile details',
directEditHint: 'You can edit your profile information directly',
security: 'Security',
preferences: 'Preferences',
edit: 'Edit',
@@ -1244,6 +1257,56 @@ const messages = {
confirmPassword: 'Confirm Password',
changePassword: 'Change Password'
},
feedback: {
title: 'Feedback',
labels: {
type: 'Feedback Type',
module: 'Feedback Module',
content: 'Feedback Content',
},
type: {
featureSuggestion: 'Feature Suggestion',
issueReport: 'Issue Report',
experienceOptimization: 'Experience Optimization',
},
module: {
knowledgeBase: 'Knowledge Base',
general: 'General',
workflow: 'Workflow',
accountPermission: 'Account & Permission',
},
placeholder: {
content: 'Please describe your issue or suggestion to help us improve continuously.',
},
msg: {
fillContent: 'Please enter feedback content',
submitFailed: 'Failed to submit feedback',
},
cancel: 'Cancel',
submitting: 'Submitting...',
submit: 'Submit',
},
kbWorkspace: {
header: {
groupOverviewTitle: 'Knowledge Base Group Overview',
workspaceTitle: 'Knowledge Base Workspace',
groupOverviewSubtitle: 'Click a group card to enter that group workspace.',
workspaceSubtitle: 'The data cleaning and knowledge base management module has been integrated into the platform. This is the phase-1 shell page.',
},
actions: {
backToOverview: 'Back to Group Overview',
backToWorkspace: 'Back to Workspace',
refreshGroups: 'Refresh Groups',
refreshDocuments: 'Refresh Documents',
},
overview: {
title: 'Knowledge Base Group Overview',
loadingGroups: 'Loading groups...',
createGroupTitle: 'Create Knowledge Base Group',
createGroupDesc: 'Use the knowledge base entry pattern. Click the button, fill the popup form, then create a new group.',
createGroupButton: 'Create Knowledge Base',
},
},
theme: {
label: 'Theme',
light: 'Light',
@@ -2333,6 +2396,10 @@ const messages = {
voiceFeature: '语音功能',
collapseBrowser: '收起浏览器',
openBrowser: '打开浏览器',
kb: {
enterprise: '企业知识库',
erp: 'ERP知识库'
},
browser: '浏览器',
closeBrowser: '关闭浏览器',
browserInputPlaceholder: '输入网址,例如 https://example.com',
@@ -2456,12 +2523,21 @@ const messages = {
profile: {
title: '个人资料',
personalInfo: '基本信息',
basicInfo: '基本信息',
department: '部门',
language: '语言',
username: '用户名',
employeeId: '工号',
realName: '姓名',
email: '邮箱',
phoneNumber: '手机号',
theme: '主题',
roleAdmin: '管理员',
roleUser: '普通用户',
unsavedChanges: '您有未保存的更改',
editHint: '切换到编辑模式以更新个人资料',
switchEditHint: '切换到编辑模式以更新个人资料',
directEditHint: '可直接编辑并保存个人资料',
security: '安全设置',
preferences: '偏好设置',
edit: '编辑',
@@ -2474,6 +2550,56 @@ const messages = {
confirmPassword: '确认密码',
changePassword: '修改密码'
},
feedback: {
title: '意见反馈',
labels: {
type: '反馈类型',
module: '反馈模块',
content: '反馈内容',
},
type: {
featureSuggestion: '功能建议',
issueReport: '问题反馈',
experienceOptimization: '体验优化',
},
module: {
knowledgeBase: '知识库',
general: '通用',
workflow: '流程',
accountPermission: '账号权限',
},
placeholder: {
content: '请描述你的问题或建议,帮助我们持续优化。',
},
msg: {
fillContent: '请填写反馈内容',
submitFailed: '提交反馈失败',
},
cancel: '取消',
submitting: '提交中...',
submit: '提交',
},
kbWorkspace: {
header: {
groupOverviewTitle: '知识库分组概览',
workspaceTitle: '知识库工作台',
groupOverviewSubtitle: '点击分组卡片进入该分组工作台。',
workspaceSubtitle: '数据清洗与知识库管理模块已接入主平台,当前为第一阶段页面壳。',
},
actions: {
backToOverview: '返回分组概览',
backToWorkspace: '返回工作台',
refreshGroups: '刷新分组',
refreshDocuments: '刷新文档',
},
overview: {
title: '知识库分组概览',
loadingGroups: '正在加载分组...',
createGroupTitle: '新增知识库分组',
createGroupDesc: '参考知识库入口,点击按钮弹窗输入后创建新分组。',
createGroupButton: '新增知识库',
},
},
theme: {
label: '主题',
light: '明亮',
@@ -3552,6 +3678,10 @@ const messages = {
voiceFeature: '語音功能',
collapseBrowser: '收起瀏覽器',
openBrowser: '打開瀏覽器',
kb: {
enterprise: '企業知識庫',
erp: 'ERP知識庫'
},
browser: '瀏覽器',
closeBrowser: '關閉瀏覽器',
browserInputPlaceholder: '輸入網址,例如 https://example.com',
@@ -3675,12 +3805,21 @@ const messages = {
profile: {
title: '個人資料',
personalInfo: '基本信息',
basicInfo: '基本資訊',
department: '部門',
language: '語言',
username: '用戶名',
employeeId: '工號',
realName: '姓名',
email: '郵箱',
phoneNumber: '手機號',
theme: '主題',
roleAdmin: '管理員',
roleUser: '用戶',
unsavedChanges: '您有尚未保存的變更',
editHint: '切換到編輯模式以更新個人資料',
switchEditHint: '切換到編輯模式以更新個人資料',
directEditHint: '可直接編輯並保存個人資料',
security: '安全設置',
preferences: '偏好設置',
edit: '編輯',
@@ -3693,6 +3832,56 @@ const messages = {
confirmPassword: '確認密碼',
changePassword: '修改密碼'
},
feedback: {
title: '意見反饋',
labels: {
type: '反饋類型',
module: '反饋模塊',
content: '反饋內容',
},
type: {
featureSuggestion: '功能建議',
issueReport: '問題反饋',
experienceOptimization: '體驗優化',
},
module: {
knowledgeBase: '知識庫',
general: '通用',
workflow: '流程',
accountPermission: '賬號權限',
},
placeholder: {
content: '請描述你的問題或建議,幫助我們持續優化。',
},
msg: {
fillContent: '請填寫反饋內容',
submitFailed: '提交反饋失敗',
},
cancel: '取消',
submitting: '提交中...',
submit: '提交',
},
kbWorkspace: {
header: {
groupOverviewTitle: '知識庫分組概覽',
workspaceTitle: '知識庫工作台',
groupOverviewSubtitle: '點擊分組卡片進入該分組工作台。',
workspaceSubtitle: '資料清洗與知識庫管理模塊已接入主平台,當前為第一階段頁面殼。',
},
actions: {
backToOverview: '返回分組概覽',
backToWorkspace: '返回工作台',
refreshGroups: '刷新分組',
refreshDocuments: '刷新文檔',
},
overview: {
title: '知識庫分組概覽',
loadingGroups: '正在加載分組...',
createGroupTitle: '新增知識庫分組',
createGroupDesc: '參考知識庫入口,點擊按鈕彈窗輸入後創建新分組。',
createGroupButton: '新增知識庫',
},
},
theme: {
label: '主題',
light: '明亮',
@@ -4688,6 +4877,10 @@ const messages = {
voiceFeature: 'ฟีเจอร์เสียง',
collapseBrowser: 'ย่อเบราว์เซอร์',
openBrowser: 'เปิดเบราว์เซอร์',
kb: {
enterprise: 'คลังความรู้ขององค์กร',
erp: 'คลังความรู้ ERP'
},
browser: 'เบราว์เซอร์',
closeBrowser: 'ปิดเบราว์เซอร์',
browserInputPlaceholder: 'ใส่ URL เช่น https://example.com',
@@ -4811,12 +5004,21 @@ const messages = {
profile: {
title: 'โปรไฟล์',
personalInfo: 'ข้อมูลส่วนตัว',
basicInfo: 'ข้อมูลพื้นฐาน',
department: 'แผนก',
language: 'ภาษา',
username: 'ชื่อผู้ใช้',
employeeId: 'รหัสพนักงาน',
realName: 'ชื่อจริง',
email: 'อีเมล',
phoneNumber: 'เบอร์โทรศัพท์',
theme: 'ธีม',
roleAdmin: 'ผู้ดูแลระบบ',
roleUser: 'ผู้ใช้',
unsavedChanges: 'คุณมีการเปลี่ยนแปลงที่ยังไม่ได้บันทึก',
editHint: 'สลับไปที่โหมดแก้ไขเพื่ออัปเดตรายละเอียดโปรไฟล์',
switchEditHint: 'สลับไปที่โหมดแก้ไขเพื่ออัปเดตรายละเอียดโปรไฟล์',
directEditHint: 'สามารถแก้ไขและบันทึกข้อมูลโปรไฟล์ได้โดยตรง',
security: 'ความปลอดภัย',
preferences: 'การตั้งค่า',
edit: 'แก้ไข',
@@ -4829,6 +5031,56 @@ const messages = {
confirmPassword: 'ยืนยันรหัสผ่าน',
changePassword: 'เปลี่ยนรหัสผ่าน'
},
feedback: {
title: 'ข้อเสนอแนะ',
labels: {
type: 'ประเภทข้อเสนอแนะ',
module: 'โมดูลที่เกี่ยวข้อง',
content: 'เนื้อหาข้อเสนอแนะ',
},
type: {
featureSuggestion: 'ข้อเสนอฟีเจอร์',
issueReport: 'รายงานปัญหา',
experienceOptimization: 'ปรับปรุงประสบการณ์',
},
module: {
knowledgeBase: 'คลังความรู้',
general: 'ทั่วไป',
workflow: 'เวิร์กโฟลว์',
accountPermission: 'บัญชีและสิทธิ์',
},
placeholder: {
content: 'กรุณาอธิบายปัญหาหรือข้อเสนอแนะของคุณ เพื่อช่วยให้เราปรับปรุงอย่างต่อเนื่อง',
},
msg: {
fillContent: 'กรุณากรอกเนื้อหาข้อเสนอแนะ',
submitFailed: 'ส่งข้อเสนอแนะไม่สำเร็จ',
},
cancel: 'ยกเลิก',
submitting: 'กำลังส่ง...',
submit: 'ส่ง',
},
kbWorkspace: {
header: {
groupOverviewTitle: 'ภาพรวมกลุ่มคลังความรู้',
workspaceTitle: 'เวิร์กสเปซคลังความรู้',
groupOverviewSubtitle: 'คลิกการ์ดกลุ่มเพื่อเข้าสู่เวิร์กสเปซของกลุ่มนั้น',
workspaceSubtitle: 'โมดูลจัดการคลังความรู้และทำความสะอาดข้อมูลได้เชื่อมเข้ากับแพลตฟอร์มแล้ว หน้านี้เป็นโครงหน้าเฟสแรก',
},
actions: {
backToOverview: 'กลับไปภาพรวมกลุ่ม',
backToWorkspace: 'กลับไปเวิร์กสเปซ',
refreshGroups: 'รีเฟรชกลุ่ม',
refreshDocuments: 'รีเฟรชเอกสาร',
},
overview: {
title: 'ภาพรวมกลุ่มคลังความรู้',
loadingGroups: 'กำลังโหลดกลุ่ม...',
createGroupTitle: 'สร้างกลุ่มคลังความรู้',
createGroupDesc: 'อ้างอิงรูปแบบทางเข้าคลังความรู้ คลิกปุ่ม กรอกในป๊อปอัป แล้วสร้างกลุ่มใหม่',
createGroupButton: 'สร้างคลังความรู้',
},
},
theme: {
label: 'ธีม',
light: 'สว่าง',
@@ -4848,3 +5100,5 @@ const i18n = createI18n({
});
export default i18n;
+7 -2
View File
@@ -52,6 +52,11 @@ const selectedKb = ref('企业知识库');
const showKbDropdown = ref(false);
const kbMenuRef = ref<HTMLElement | null>(null);
const kbOptions = ['企业知识库', 'ERP知识库'];
const getKbLabel = (kb: string) => {
if (kb === '企业知识库') return t('chat.kb.enterprise');
if (kb === 'ERP知识库') return t('chat.kb.erp');
return kb;
};
const chatScrollContainer = ref<HTMLElement | null>(null);
let scrollToBottomFrame: number | null = null;
let wasThinking = false;
@@ -2454,7 +2459,7 @@ const showChatRating = ref(false);
class="flex items-center gap-1 rounded-lg border border-slate-200 px-3 py-1.5 text-xs font-medium text-slate-600 transition-colors hover:bg-slate-50 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800"
>
<Database class="h-3.5 w-3.5 text-brand-500" />
{{ selectedKb }} <ChevronDown class="h-3 w-3" />
{{ getKbLabel(selectedKb) }} <ChevronDown class="h-3 w-3" />
</button>
<div
v-if="showKbDropdown"
@@ -2467,7 +2472,7 @@ const showChatRating = ref(false);
class="flex w-full items-center justify-between px-3 py-2 text-xs text-slate-700 transition-colors hover:bg-slate-50 dark:text-slate-300 dark:hover:bg-slate-800"
:class="{ 'font-bold text-brand-700 dark:text-brand-300': selectedKb === option }"
>
{{ option }}
{{ getKbLabel(option) }}
<Check v-if="selectedKb === option" class="h-3.5 w-3.5" />
</button>
</div>
+11 -11
View File
@@ -1,6 +1,7 @@
<script setup lang="ts">
import { computed, onMounted, onUnmounted, ref, watch } from 'vue';
import { useRouter } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { ArrowLeft, BookOpen, ChevronDown, ChevronUp, FileText, FolderPlus, Info, Pencil, RefreshCw, Trash2, Upload, X } from 'lucide-vue-next';
import DeleteConfirmDialog from '../components/DeleteConfirmDialog.vue';
import {
@@ -37,6 +38,7 @@ const props = defineProps<{
}>();
const router = useRouter();
const { t } = useI18n({ useScope: 'global' });
const isLoading = ref(true);
const isDocumentsLoading = ref(false);
@@ -1452,7 +1454,7 @@ onUnmounted(() => {
v-if="!embedded || (embedded && viewMode === 'group_detail')"
@click="embedded ? backToGroupOverview() : router.push('/workspace')"
class="rounded-2xl border border-slate-200 p-3 text-slate-500 transition-colors hover:bg-slate-50 hover:text-slate-900 dark:border-slate-700 dark:text-slate-300 dark:hover:bg-slate-800 dark:hover:text-white"
:title="embedded ? '返回分组概览' : '返回工作台'"
:title="embedded ? t('kbWorkspace.actions.backToOverview') : t('kbWorkspace.actions.backToWorkspace')"
>
<ArrowLeft class="h-5 w-5" />
</button>
@@ -1463,10 +1465,10 @@ onUnmounted(() => {
</div>
<div>
<h1 class="text-2xl font-bold text-slate-900 dark:text-slate-100">
{{ viewMode === 'group_overview' ? '知识库分组概览' : '知识库工作台' }}
{{ viewMode === 'group_overview' ? t('kbWorkspace.header.groupOverviewTitle') : t('kbWorkspace.header.workspaceTitle') }}
</h1>
<p class="mt-1 text-sm text-slate-500 dark:text-slate-400">
{{ viewMode === 'group_overview' ? '点击分组卡片进入该分组工作台。' : '数据清洗与知识库管理模块已接入主平台,当前为第一阶段页面壳。' }}
{{ viewMode === 'group_overview' ? t('kbWorkspace.header.groupOverviewSubtitle') : t('kbWorkspace.header.workspaceSubtitle') }}
</p>
</div>
</div>
@@ -1478,7 +1480,7 @@ onUnmounted(() => {
class="inline-flex items-center gap-2 rounded-2xl border border-slate-200 px-4 py-2.5 text-sm font-medium text-slate-700 transition-colors hover:bg-slate-50 dark:border-slate-700 dark:text-slate-200 dark:hover:bg-slate-800"
>
<RefreshCw class="h-4 w-4" />
{{ viewMode === 'group_overview' ? '刷新分组' : '刷新文档' }}
{{ viewMode === 'group_overview' ? t('kbWorkspace.actions.refreshGroups') : t('kbWorkspace.actions.refreshDocuments') }}
</button>
</div>
</div>
@@ -1486,28 +1488,26 @@ onUnmounted(() => {
<template v-if="viewMode === 'group_overview'">
<section class="rounded-3xl border border-slate-200 bg-white p-6 shadow-sm dark:border-slate-700 dark:bg-slate-900">
<div class="mb-4 flex items-center justify-between">
<h2 class="text-lg font-semibold text-slate-900 dark:text-slate-100">知识库分组概览</h2>
<h2 class="text-lg font-semibold text-slate-900 dark:text-slate-100">{{ t('kbWorkspace.overview.title') }}</h2>
<span class="text-xs text-slate-400">`/api/kb/groups`</span>
</div>
<div v-if="isLoading" class="py-10 text-center text-sm text-slate-400">正在加载分组...</div>
<div v-if="isLoading" class="py-10 text-center text-sm text-slate-400">{{ t('kbWorkspace.overview.loadingGroups') }}</div>
<div v-else class="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3 auto-rows-fr">
<div class="rounded-2xl border border-slate-200 p-4 transition-colors hover:border-brand-300 dark:border-slate-700 h-full min-h-[260px] flex flex-col">
<div class="mb-3 flex items-center gap-2">
<div class="flex h-8 w-8 items-center justify-center rounded-xl bg-brand-50 text-brand-600 dark:bg-brand-500/10">
<FolderPlus class="h-4 w-4" />
</div>
<div class="font-semibold text-slate-900 dark:text-slate-100">新增知识库分组</div>
</div>
<div class="text-sm text-slate-500 dark:text-slate-400">
参考知识库入口,点击按钮弹窗输入后创建新分组。
<div class="font-semibold text-slate-900 dark:text-slate-100">{{ t('kbWorkspace.overview.createGroupTitle') }}</div>
</div>
<div class="text-sm text-slate-500 dark:text-slate-400">{{ t('kbWorkspace.overview.createGroupDesc') }}</div>
<div class="mt-auto pt-3">
<button
@click="openCreateGroupModal"
class="inline-flex w-full items-center justify-center gap-2 rounded-xl bg-brand-600 px-3 py-2 text-sm font-medium text-white transition-colors hover:bg-brand-700 disabled:cursor-not-allowed disabled:opacity-60"
>
<FolderPlus class="h-4 w-4" />
新增知识库
{{ t('kbWorkspace.overview.createGroupButton') }}
</button>
<p
v-if="feedback"