From 54ebfc30f2c66570b0566e9e78d1fd230967d23f Mon Sep 17 00:00:00 2001 From: wangdan-fit2cloud Date: Thu, 27 Feb 2025 16:19:03 +0800 Subject: [PATCH] fix: Modify generate question page translation and bugs --- .../ai-chat/component/user-form/index.vue | 2 ++ ui/src/components/generate-related-dialog/index.vue | 9 ++++----- ui/src/locales/lang/en-US/components.ts | 7 ++++++- ui/src/locales/lang/en-US/views/document.ts | 13 +++---------- ui/src/locales/lang/en-US/views/problem.ts | 1 - ui/src/locales/lang/zh-CN/components.ts | 5 +++++ ui/src/locales/lang/zh-CN/views/document.ts | 6 ------ ui/src/locales/lang/zh-CN/views/problem.ts | 1 - ui/src/locales/lang/zh-Hant/components.ts | 5 +++++ ui/src/locales/lang/zh-Hant/views/document.ts | 6 ------ ui/src/locales/lang/zh-Hant/views/problem.ts | 1 - .../document/component/EmbeddingContentDialog.vue | 6 +++--- .../views/problem/component/RelateProblemDialog.vue | 2 +- .../base-node/component/UserInputTitleDialog.vue | 11 +++++------ 14 files changed, 34 insertions(+), 41 deletions(-) diff --git a/ui/src/components/ai-chat/component/user-form/index.vue b/ui/src/components/ai-chat/component/user-form/index.vue index 980ad8663..39759a831 100644 --- a/ui/src/components/ai-chat/component/user-form/index.vue +++ b/ui/src/components/ai-chat/component/user-form/index.vue @@ -16,7 +16,9 @@ + {{ inputFieldConfig.title }} + diff --git a/ui/src/components/generate-related-dialog/index.vue b/ui/src/components/generate-related-dialog/index.vue index 4d485eae0..373152361 100644 --- a/ui/src/components/generate-related-dialog/index.vue +++ b/ui/src/components/generate-related-dialog/index.vue @@ -48,13 +48,13 @@ type="textarea" /> - + - {{ - $t('views.document.form.selectVectorization.error') + {{ + $t('components.selectParagraph.error') }} {{ - $t('views.document.form.selectVectorization.all') + $t('components.selectParagraph.all') }} @@ -148,7 +148,6 @@ const submitHandle = async (formEl: FormInstance) => { const data = { ...form.value, paragraph_id_list: idList.value, - state_list: stateMap[state.value] } paragraphApi.batchGenerateRelated(id, documentId, data, loading).then(() => { MsgSuccess(t('views.document.generateQuestion.successMessage')) diff --git a/ui/src/locales/lang/en-US/components.ts b/ui/src/locales/lang/en-US/components.ts index ce54bd265..fd63f8345 100644 --- a/ui/src/locales/lang/en-US/components.ts +++ b/ui/src/locales/lang/en-US/components.ts @@ -3,5 +3,10 @@ export default { quickCreateName: 'document name', noData: 'No Data', loading: 'Loading', - noMore: 'No more!' + noMore: 'No more! ', + selectParagraph: { + title: 'Select Paragraph', + error: 'Process only the failed segments', + all: 'All Segments' + } } diff --git a/ui/src/locales/lang/en-US/views/document.ts b/ui/src/locales/lang/en-US/views/document.ts index 14867b162..8eefd00fa 100644 --- a/ui/src/locales/lang/en-US/views/document.ts +++ b/ui/src/locales/lang/en-US/views/document.ts @@ -12,7 +12,7 @@ export default { cancelGenerateQuestion: 'Cancel Generating Questions', cancelVectorization: 'Cancel Vectorization', cancelGenerate: 'Cancel Generation', - export: 'Export to', + export: 'Export to' }, tip: { saveMessage: 'Current changes have not been saved. Confirm exit?', @@ -84,8 +84,7 @@ export default { text: 'Remove duplicate extra symbols, spaces, blank lines, and tab words.' }, checkedConnect: { - label: - 'Add "Related Questions" section for question-based QA pairs during import.' + label: 'Add "Related Questions" section for question-based QA pairs during import.' } }, buttons: { @@ -153,11 +152,6 @@ export default { label: 'Similarity Higher Than', placeholder: 'Directly return segment content', requiredMessage: 'Please enter similarity value' - }, - selectVectorization: { - label: 'Select Vectorization Content', - error: 'Segments that failed vectorization', - all: 'All Segments' } }, hitHandlingMethod: { @@ -173,7 +167,6 @@ export default { tip4: 'The generation effect depends on the selected model and prompt. Users can adjust to achieve the best effect.', prompt1: 'Content: {data}\n \n Please summarize the above and generate 5 questions based on the summary. \nAnswer requirements: \n - Please output only questions; \n - Please place each question in', - prompt2: 'tag.', - error: 'Segments only failed', + prompt2: 'tag.' } } diff --git a/ui/src/locales/lang/en-US/views/problem.ts b/ui/src/locales/lang/en-US/views/problem.ts index f312cce6a..cd9780b59 100644 --- a/ui/src/locales/lang/en-US/views/problem.ts +++ b/ui/src/locales/lang/en-US/views/problem.ts @@ -31,7 +31,6 @@ export default { title: 'Relate to Segment', selectDocument: 'Select a Document', placeholder: 'Search document by name', - selectParagraph: 'Select Segments', selectedParagraph: 'Selected Segments', count: 'Count' } diff --git a/ui/src/locales/lang/zh-CN/components.ts b/ui/src/locales/lang/zh-CN/components.ts index 589a14337..5b871daf1 100644 --- a/ui/src/locales/lang/zh-CN/components.ts +++ b/ui/src/locales/lang/zh-CN/components.ts @@ -4,4 +4,9 @@ export default { noData: '无匹配数据', loading: '加载中', noMore: '到底啦!', + selectParagraph: { + title: '选择分段', + error: '仅执行未成功分段', + all: '全部分段' + } } diff --git a/ui/src/locales/lang/zh-CN/views/document.ts b/ui/src/locales/lang/zh-CN/views/document.ts index a5ca5a4a3..73a1ef6e9 100644 --- a/ui/src/locales/lang/zh-CN/views/document.ts +++ b/ui/src/locales/lang/zh-CN/views/document.ts @@ -150,11 +150,6 @@ export default { placeholder: '直接返回分段内容', requiredMessage: '请输入相似度' }, - selectVectorization: { - label: '选择向量化内容', - error: '向量化未成功的分段', - all: '全部分段' - } }, hitHandlingMethod: { optimization: '模型优化', @@ -169,6 +164,5 @@ export default { tip4: '生成效果依赖于所选模型和提示词,用户可自行调整至最佳效果。', prompt1: `内容:{data}\n\n请总结上面的内容,并根据内容总结生成 5 个问题。\n回答要求:\n- 请只输出问题;\n- 请将每个问题放置`, prompt2: `标签中。`, - error: '仅执行未成功的分段', } } diff --git a/ui/src/locales/lang/zh-CN/views/problem.ts b/ui/src/locales/lang/zh-CN/views/problem.ts index 53fc24c98..bb53275aa 100644 --- a/ui/src/locales/lang/zh-CN/views/problem.ts +++ b/ui/src/locales/lang/zh-CN/views/problem.ts @@ -31,7 +31,6 @@ export default { title: '关联分段', selectDocument: '选择文档', placeholder: '按 文档名称 搜索', - selectParagraph: '选择分段', selectedParagraph: '已选分段', count: '个' }, diff --git a/ui/src/locales/lang/zh-Hant/components.ts b/ui/src/locales/lang/zh-Hant/components.ts index a7c3592cf..da25a3709 100644 --- a/ui/src/locales/lang/zh-Hant/components.ts +++ b/ui/src/locales/lang/zh-Hant/components.ts @@ -4,4 +4,9 @@ export default { noData: '無匹配数据', loading: '加載中', noMore: '到底啦!', + selectParagraph: { + title: '選擇分段', + error: '僅執行未成功分段', + all: '全部分段' + } } diff --git a/ui/src/locales/lang/zh-Hant/views/document.ts b/ui/src/locales/lang/zh-Hant/views/document.ts index 087fab73b..383958afd 100644 --- a/ui/src/locales/lang/zh-Hant/views/document.ts +++ b/ui/src/locales/lang/zh-Hant/views/document.ts @@ -150,11 +150,6 @@ export default { placeholder: '直接返回分段内容', requiredMessage: '请输入相似度' }, - selectVectorization: { - label: '選擇向量化', - error: '向量化未成功的分段', - all: '全部分段' - } }, hitHandlingMethod: { optimization: '模型優化', @@ -169,6 +164,5 @@ export default { tip4: '生成效果取決於所選模型和提示詞,用戶可自行調整至最佳效果。', prompt1: `內容:{data}\n\n請總結上面的內容,並根據內容總結生成 5 個問題。\n回答要求:\n - 請只輸出問題;\n - 請將每個問題放置在`, prompt2: `標籤中。`, - error: '只執行未成功的分段', } } diff --git a/ui/src/locales/lang/zh-Hant/views/problem.ts b/ui/src/locales/lang/zh-Hant/views/problem.ts index 0fb8b30d9..12cb86020 100644 --- a/ui/src/locales/lang/zh-Hant/views/problem.ts +++ b/ui/src/locales/lang/zh-Hant/views/problem.ts @@ -31,7 +31,6 @@ export default { title: '關聯分段', selectDocument: '選擇文件', placeholder: '按 文件名稱 搜尋', - selectParagraph: '選擇分段', selectedParagraph: '已選分段', count: '個' }, diff --git a/ui/src/views/document/component/EmbeddingContentDialog.vue b/ui/src/views/document/component/EmbeddingContentDialog.vue index 4ceb05639..8d3616ec8 100644 --- a/ui/src/views/document/component/EmbeddingContentDialog.vue +++ b/ui/src/views/document/component/EmbeddingContentDialog.vue @@ -1,15 +1,15 @@