feat: i18n

This commit is contained in:
wangdan-fit2cloud 2025-01-21 17:57:31 +08:00
parent 7779dbe1b0
commit 4dc2036530
28 changed files with 91 additions and 57 deletions

View File

@ -103,7 +103,7 @@ function submitHandle() {
loading.value = false
}, 200)
} else {
MsgError(`${props.quickCreateName}${t('dynamicsForm.tip.requiredMessage')}`)
MsgError(`${props.quickCreateName} ${t('dynamicsForm.tip.requiredMessage')}`)
}
}

View File

@ -105,8 +105,8 @@ const errMsg = computed(() => {
return props_info.value.err_msg
? props_info.value.err_msg
: isString(props.formfield.label)
? props.formfield.label + t('dynamicsForm.tip.requiredMessage')
: props.formfield.label.label + t('dynamicsForm.tip.requiredMessage')
? props.formfield.label + ' ' + t('dynamicsForm.tip.requiredMessage')
: props.formfield.label.label + ' ' + t('dynamicsForm.tip.requiredMessage')
})
/**
* 反序列化

View File

@ -40,7 +40,12 @@
</el-col>
</el-form-item>
<el-col :span="11" style="padding-left: 0">
<el-form-item :label="$t('dynamicsForm.Slider.step.label')" required prop="step" :rules="step_rules">
<el-form-item
:label="$t('dynamicsForm.Slider.step.label')"
required
prop="step"
:rules="step_rules"
>
<el-input-number
style="width: 100%"
v-model="formValue.step"
@ -101,7 +106,7 @@ const getData = () => {
props_info: {
rules: [
{
message: formValue.value.label + t('dynamicsForm.tip.requiredMessage'),
message: formValue.value.label + ' ' + t('dynamicsForm.tip.requiredMessage'),
trigger: 'blur',
required: formValue.value.required
}

View File

@ -19,9 +19,9 @@
<AppIcon iconName="app-warning-colorful" style="font-size: 16px"></AppIcon>
</div>
<div class="ml-12 lighter">
<p>{{ $t('views.document.setting.generateQuestion.tip1', { data: '{data}' }) }}</p>
<p>{{ $t('views.document.setting.generateQuestion.tip2') }}</p>
<p>{{ $t('views.document.setting.generateQuestion.tip3') }}</p>
<p>{{ $t('views.document.generateQuestion.tip1', { data: '{data}' }) }}</p>
<p>{{ $t('views.document.generateQuestion.tip2') }}</p>
<p>{{ $t('views.document.generateQuestion.tip3') }}</p>
</div>
</div>
<el-form-item
@ -124,14 +124,14 @@ const submitHandle = async (formEl: FormInstance) => {
if (apiType.value === 'paragraph') {
const data = { ...form.value, paragraph_id_list: idList.value }
paragraphApi.batchGenerateRelated(id, documentId, data, loading).then(() => {
MsgSuccess(t('views.document.setting.generateQuestion.successMessage'))
MsgSuccess(t('views.document.generateQuestion.successMessage'))
emit('refresh')
dialogVisible.value = false
})
} else if (apiType.value === 'document') {
const data = { ...form.value, document_id_list: idList.value }
documentApi.batchGenerateRelated(id, data, loading).then(() => {
MsgSuccess(t('views.document.setting.generateQuestion.successMessage'))
MsgSuccess(t('views.document.generateQuestion.successMessage'))
emit('refresh')
dialogVisible.value = false
})

View File

@ -1,7 +1,7 @@
<template>
<el-dialog
v-model="resetPasswordDialog"
:title="$t('layout.avatar.resetPassword')"
:title="$t('views.login.resetPassword')"
:close-on-click-modal="false"
:close-on-press-escape="false"
>

View File

@ -67,7 +67,7 @@ export default {
title: 'Execution Details',
paramInput: 'Parameter Input',
paramOutput: 'Parameter Output',
paramOutputTooltip: 'Each document supports preview of up to 500 characters',
paramOutputTooltip: 'Each document supports preview of up to 500 words',
audioFile: 'Audio File',
searchContent: 'Search Content',
searchResult: 'Search Results',
@ -91,7 +91,7 @@ export default {
consumeTime: 'Time Consumed'
},
paragraphSource: {
title: 'Knowledge Base Reference',
title: 'Knowledge Reference',
question: 'User Question',
optimizationQuestion: 'Optimized Question'
}

View File

@ -27,7 +27,7 @@ export default {
createDate: 'Create date',
createTime: 'Create time',
operation: 'Operation',
character: 'characters',
character: 'words',
export: 'Export',
exportSuccess: 'Export successful',
unavailable: '(Unavailable)',

View File

@ -164,7 +164,7 @@ Please output an optimized question.`,
},
higher: 'Higher',
ScoreTooltip: 'The higher the Score, the stronger the relevance.',
max_paragraph_char_number: 'Maximum number of characters to quote',
max_paragraph_char_number: 'Maximum number of words to quote',
reranker_model: {
label: 'Rerank',
placeholder: 'Please select a Rerank'

View File

@ -127,11 +127,12 @@ export default {
hybridSearchTooltip:
'Hybrid search is a retrieval method based on both vector and text similarity, suitable for medium data volumes in the knowledge.',
similarityThreshold: 'Similarity Threshold',
similarityTooltip: 'The higher the similarity, the stronger the correlation。',
topReferences: 'Top N References',
maxCharacters: 'Maximum Characters per Reference',
maxCharacters: 'Maximum words per Reference',
noReferencesAction: 'When there are no knowledge references',
continueQuestioning: 'Continue Questioning AI Model',
provideAnswer: 'Provide a Specific Answer',
continueQuestioning: 'Continue to ask questions to the Al model',
provideAnswer: 'Provide a specific answer',
designated_answer:
'Hello, I am XXX Assistant. My knowledge only contains information related to XXX products. Please rephrase your question.',
defaultPrompt1:

View File

@ -3,7 +3,9 @@ export default {
createDataset: 'Create Knowledge',
general: 'General',
web: 'Web Site',
relatedApplications: 'Related App',
relatedApplications: 'Linked App',
document_count: 'docs',
relatedApp_count: 'linked apps',
searchBar: {
placeholder: 'Search by name'
},

View File

@ -80,7 +80,7 @@ export default {
},
with_filter: {
label: 'Auto Clean',
text: 'Remove duplicate extra symbols, spaces, blank lines, and tab characters.'
text: 'Remove duplicate extra symbols, spaces, blank lines, and tab words.'
},
checkedConnect: {
label:
@ -95,7 +95,7 @@ export default {
},
table: {
name: 'File Name',
char_length: 'Character',
char_length: 'words',
paragraph: 'Segment',
all: 'All',
updateTime: 'Update Time'
@ -166,7 +166,11 @@ export default {
title: 'Generate Questions',
successMessage: 'Question generation successful',
tip1: 'The {data} in the prompt is a placeholder for segmented content, which is replaced by the segmented content when executed and sent to the AI model;',
tip2: 'The AI model generates relevant questions based on the segmented content. Please place the generated questions within the <question></question> tags, and the system will automatically associate the questions within these tags;',
tip3: 'The generation effect depends on the selected model and prompt. Users can adjust to achieve the best effect.'
tip2: 'The AI model generates relevant questions based on the segmented content. Please place the generated questions within the &lt;question&gt;&lt;/question&gt; tags, and the system will automatically associate the questions within these tags;',
tip3: 'The generation effect depends on the selected model and prompt. Users can adjust to achieve the best effect.',
prompt:`Content: {data}\n
\n
Please summarize the above content and generate a summary based on the content 5 a question. \n
Answer requirements: \n - Please output only questions; \n - Please place each question in&lt;question&gt;&lt;/question&gt;tag.`
}
}

View File

@ -2,7 +2,7 @@ export default {
title: 'Login',
jump_tip: 'You will be redirected to the authentication source page for authentication',
jump: 'Redirect',
resetPassword: 'Reset Password',
resetPassword: 'Change Password',
forgotPassword: 'Forgot Password',
userRegister: 'User Registration',
buttons: {

View File

@ -3,7 +3,7 @@ export default {
editParagraph: 'Edit Paragraph',
addParagraph: 'Add Paragraph',
paragraphDetail: 'Paragraph Details',
character_count: 'characters',
character_count: 'words',
setting: {
batchSelected: 'Batch Select',
cancelSelected: 'Cancel Selection'
@ -25,7 +25,7 @@ export default {
label: 'Paragraph Content',
placeholder: 'Please enter the paragraph content',
requiredMessage1: 'Please enter the paragraph content',
requiredMessage2: 'Content must not exceed 100,000 characters'
requiredMessage2: 'Content must not exceed 100,000 words'
}
}
}

View File

@ -53,7 +53,7 @@ export default {
permissionType: {
label: 'Permission',
privateDesc: 'Only the current user can use',
publicDesc: 'All users can use, but cannot be edited',
publicDesc: 'All users can use, but can not be edited',
requiredMessage: 'Permission cannot be empty'
},
model_type: {

View File

@ -26,7 +26,7 @@ export default {
label: 'Username',
placeholder: 'Please enter username',
requiredMessage: 'Please enter username',
lengthMessage: 'Length must be between 6 and 20 characters'
lengthMessage: 'Length must be between 6 and 20 words'
},
nick_name: {
label: 'Name',
@ -45,7 +45,7 @@ export default {
label: 'Login Password',
placeholder: 'Please enter password',
requiredMessage: 'Please enter password',
lengthMessage: 'Length must be between 6 and 20 characters'
lengthMessage: 'Length must be between 6 and 20 words'
},
new_password: {
label: 'New Password',

View File

@ -4,6 +4,8 @@ export default {
general: '通用型',
web: 'web 站点',
relatedApplications: '关联应用',
document_count: '文档数',
relatedApp_count: '关联应用',
searchBar: {
placeholder: '按名称搜索'
},
@ -78,5 +80,5 @@ export default {
complete: '整体同步',
completeText: '先删除本地知识库所有文档,重新获取 Web 站点文档',
tip: '注意:所有同步都会删除已有数据重新获取新数据,请谨慎操作。'
},
}
}

View File

@ -163,6 +163,12 @@ export default {
successMessage: '生成问题成功',
tip1: '提示词中的 {data} 为分段内容的占位符,执行时替换为分段内容发送给 AI 模型;',
tip2: 'AI 模型根据分段内容生成相关问题,请将生成的问题放至&lt;question&gt;&lt;/question&gt;标签中,系统会自动关联标签中的问题;',
tip3: '生成效果依赖于所选模型和提示词,用户可自行调整至最佳效果。'
tip3: '生成效果依赖于所选模型和提示词,用户可自行调整至最佳效果。',
prompt:`内容:{data}\n
\n
5 \n
\n
- \n
- &lt;question&gt;&lt;/question&gt;`
}
}

View File

@ -4,6 +4,8 @@ export default {
general: '通用型',
web: 'Web 站點',
relatedApplications: '關聯應用',
document_count: '文檔數',
relatedApp_count: '關聯應用',
searchBar: {
placeholder: '按名稱搜尋'
},

View File

@ -163,7 +163,11 @@ export default {
title: '生成問題',
successMessage: '生成問題成功',
tip1: '提示詞中的 {data} 為分段內容的佔位符,執行時替換為分段內容並發送給 AI 模型;',
tip2: 'AI 模型根據分段內容生成相關問題,請將生成的問題放置於 <question></question> 標籤中,系統會自動關聯標籤中的問題;',
tip3: '生成效果取決於所選模型和提示詞,用戶可自行調整至最佳效果。'
tip2: 'AI 模型根據分段內容生成相關問題,請將生成的問題放置於&lt;question&gt;&lt;/question&gt; 標籤中,系統會自動關聯標籤中的問題;',
tip3: '生成效果取決於所選模型和提示詞,用戶可自行調整至最佳效果。',
prompt:`內容:{data}\n
\n
5 \n
\n - \n - &lt;question&gt;&lt;/question&gt;`
}
}

View File

@ -1,5 +1,5 @@
import { defineStore } from 'pinia'
import { t } from '@/locales'
export interface promptTypes {
user: string
formValue: { model_id: string, prompt: string }
@ -26,12 +26,7 @@ const usePromptStore = defineStore({
}
return {
model_id: '',
prompt: '内容:{data}\n' +
'\n' +
'请总结上面的内容,并根据内容总结生成 5 个问题。\n' +
'回答要求:\n' +
'- 请只输出问题;\n' +
'- 请将每个问题放置<question></question>标签中。'
prompt: t('views.document.generateQuestion.prompt', { data: '{data}' })
}
}
}

View File

@ -133,6 +133,9 @@ h5 {
.max-w-200 {
max-width: 200px;
}
.max-w-350 {
max-width: 350px;
}
.mt-4 {
margin-top: calc(var(--app-base-px) - 4px);

View File

@ -121,6 +121,7 @@
})
"
placement="right"
popper-class="max-w-350"
>
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
</el-tooltip>
@ -247,6 +248,7 @@
question: '{question}'
})
"
popper-class="max-w-350"
placement="right"
>
<AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon>
@ -291,9 +293,13 @@
</span>
<div class="flex">
<el-checkbox v-if="applicationForm.stt_model_enable" v-model="applicationForm.stt_autosend">{{
$t('views.application.applicationForm.form.voiceInput.autoSend')
}}</el-checkbox>
<el-checkbox
v-if="applicationForm.stt_model_enable"
v-model="applicationForm.stt_autosend"
>{{
$t('views.application.applicationForm.form.voiceInput.autoSend')
}}</el-checkbox
>
<el-switch
class="ml-8"
size="small"
@ -331,9 +337,13 @@
>
</span>
<div class="flex">
<el-checkbox v-if="applicationForm.tts_model_enable" v-model="applicationForm.tts_autoplay">{{
$t('views.application.applicationForm.form.voicePlay.autoPlay')
}}</el-checkbox>
<el-checkbox
v-if="applicationForm.tts_model_enable"
v-model="applicationForm.tts_autoplay"
>{{
$t('views.application.applicationForm.form.voicePlay.autoPlay')
}}</el-checkbox
>
<el-switch
class="ml-8"
size="small"
@ -365,9 +375,9 @@
$t('views.application.applicationForm.form.voicePlay.placeholder')
"
:options="ttsModelOptions"
@change="ttsModelChange()"
@change="ttsModelChange()"
></ModelSelect>
<el-button
v-if="applicationForm.tts_type === 'TTS'"
@click="openTTSParamSettingDialog"

View File

@ -112,10 +112,10 @@
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item @click="exportMarkdown"
>{{ $t('common.exprt') }} Markdown</el-dropdown-item
>{{ $t('common.export') }} Markdown</el-dropdown-item
>
<el-dropdown-item @click="exportHTML"
>{{ $t('common.exprt') }} HTML</el-dropdown-item
>{{ $t('common.export') }} HTML</el-dropdown-item
>
</el-dropdown-menu>
</template>

View File

@ -2,7 +2,7 @@
<el-dialog
:title="$t('views.dataset.createDataset')"
v-model="dialogVisible"
width="680"
width="720"
append-to-body
:close-on-click-modal="false"
:close-on-press-escape="false"

View File

@ -101,7 +101,7 @@
</el-checkbox>
</div>
<div class="text-right mt-8">
<el-button @click="splitDocument"> {{ $t('views.document.setRules.buttons.preview') }}</el-button>
<el-button @click="splitDocument"> {{ $t('views.document.buttons.preview') }}</el-button>
</div>
</div>
</el-col>

View File

@ -85,11 +85,11 @@
<div class="footer-content flex-between">
<div>
<span class="bold">{{ item?.document_count || 0 }}</span>
{{ $t('common.fileUpload.document') }}<el-divider direction="vertical" />
{{ $t('views.dataset.document_count') }}<el-divider direction="vertical" />
<span class="bold">{{ numberFormat(item?.char_length) || 0 }}</span>
{{ $t('common.character') }}<el-divider direction="vertical" />
<span class="bold">{{ item?.application_mapping_count || 0 }}</span>
{{ $t('views.dataset.relatedApplications') }}
{{ $t('views.dataset.relatedApp_count') }}
</div>
<div @click.stop>
<el-dropdown trigger="click">

View File

@ -45,11 +45,11 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item :label="$t('views.log.addToDatase.saveToDocument')" prop="document_id">
<el-form-item :label="$t('views.log.saveToDocument')" prop="document_id">
<el-select
v-model="form.document_id"
filterable
:placeholder="$t('views.log.addToDatase.documentPlaceholder')"
:placeholder="$t('views.log.documentPlaceholder')"
:loading="optionLoading"
>
<el-option

View File

@ -159,7 +159,7 @@ function mulAssociation() {
}))
}
problemApi.postMulAssociationProblem(id, data, loading).then(() => {
MsgSuccess(t('views.problem.relatedSuccess'))
MsgSuccess(t('views.problem.tip.relatedSuccess'))
dialogVisible.value = false
})
}