fix: i18n bugs

This commit is contained in:
wangdan-fit2cloud 2025-01-22 11:26:03 +08:00
parent 495ac39498
commit 6009d929cf
17 changed files with 39 additions and 27 deletions

View File

@ -60,7 +60,7 @@
</el-dropdown> </el-dropdown>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item class="border-t" @click="openAbout"> <el-dropdown-item class="border-t" @click="openAbout">
{{ $t('layout.about.label') }} {{ $t('layout.about.title') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item class="border-t" @click="logout"> <el-dropdown-item class="border-t" @click="logout">

View File

@ -126,8 +126,8 @@ export default {
label: 'Question Optimization', label: 'Question Optimization',
text: 'Optimize and improve the current question based on historical chat records to better match knowledge segments', text: 'Optimize and improve the current question based on historical chat records to better match knowledge segments',
result: 'Optimized Question Result', result: 'Optimized Question Result',
defaultPrompt: `Optimize and improve the user's question based on context: {{start.question}} defaultPrompt1: `Optimize and improve the user's question based on context:`,
Please output an optimized question.`, defaultPrompt2: `Please output an optimized question.`,
systemDefault: 'You are a question optimization expert' systemDefault: 'You are a question optimization expert'
}, },
conditionNode: { conditionNode: {
@ -178,8 +178,10 @@ Please output an optimized question.`,
form_data: 'All Form Content', form_data: 'All Form Content',
formContent: { formContent: {
label: 'Form Output Content', label: 'Form Output Content',
requiredMessage: 'Please set the output content of this node, { form } is a placeholder for the form.', requiredMessage:
tooltip: 'Set the content output by executing this node, { form } is a placeholder for the form.' 'Please set the output content of this node, { form } is a placeholder for the form.',
tooltip:
'Set the content output by executing this node, { form } is a placeholder for the form.'
}, },
formAllContent: 'All Form Content', formAllContent: 'All Form Content',
formSetting: 'Form Configuration' formSetting: 'Form Configuration'
@ -212,12 +214,15 @@ Please output an optimized question.`,
}, },
prompt: { prompt: {
label: 'Positive Prompt', label: 'Positive Prompt',
tooltip: 'Positive prompt words, used to describe elements and visual features expected in the generated image' tooltip:
'Positive prompt words, used to describe elements and visual features expected in the generated image'
}, },
negative_prompt: { negative_prompt: {
label: 'Negative Prompt', label: 'Negative Prompt',
tooltip: 'Negative prompt words, used to describe content that should not appear in the image, which can limit the image.', tooltip:
placeholder: 'Please describe content you do not want to generate, such as color, bloody content' 'Negative prompt words, used to describe content that should not appear in the image, which can limit the image.',
placeholder:
'Please describe content you do not want to generate, such as color, bloody content'
} }
}, },
speechToTextNode: { speechToTextNode: {

View File

@ -62,6 +62,8 @@ export default {
references: ' (References Knowledge)', references: ' (References Knowledge)',
placeholder: 'Please enter prompt', placeholder: 'Please enter prompt',
requiredMessage: 'Please enter prompt', requiredMessage: 'Please enter prompt',
tooltip:'By adjusting the content of the prompt, you can guide the direction of the large model conversation.',
noReferencesTooltip: noReferencesTooltip:
'By adjusting the content of the prompt, you can guide the direction of the large model conversation. This prompt will be fixed at the beginning of the context. Variables used: {question} is the question posed by the user.', 'By adjusting the content of the prompt, you can guide the direction of the large model conversation. This prompt will be fixed at the beginning of the context. Variables used: {question} is the question posed by the user.',
referencesTooltip: referencesTooltip:

View File

@ -48,7 +48,7 @@ export default {
}, },
datasetType: { datasetType: {
label: 'Knowledge Type', label: 'Knowledge Type',
generalInfo: 'Upload local files or manually enter', generalInfo: 'Upload local documents',
webInfo: 'Sync text data from a Web site' webInfo: 'Sync text data from a Web site'
}, },
source_url: { source_url: {

View File

@ -95,7 +95,7 @@ export default {
}, },
table: { table: {
name: 'File Name', name: 'File Name',
char_length: 'words', char_length: 'Words',
paragraph: 'Segment', paragraph: 'Segment',
all: 'All', all: 'All',
updateTime: 'Update Time' updateTime: 'Update Time'

View File

@ -76,7 +76,7 @@ export default {
base_model: { base_model: {
label: 'Base Model', label: 'Base Model',
tooltip: tooltip:
'For models not listed in the list, enter the model name directly and press Enter to add', 'For models not listed, enter the model name and press Enter.',
placeholder: 'Enter the base model name and press Enter to add', placeholder: 'Enter the base model name and press Enter to add',
requiredMessage: 'Base model cannot be empty' requiredMessage: 'Base model cannot be empty'
} }

View File

@ -127,8 +127,8 @@ export default {
label: '问题优化', label: '问题优化',
text: '根据历史聊天记录优化完善当前问题,更利于匹配知识库分段', text: '根据历史聊天记录优化完善当前问题,更利于匹配知识库分段',
result: '问题优化结果', result: '问题优化结果',
defaultPrompt: `根据上下文优化和完善用户问题{{开始.question}} defaultPrompt1: `根据上下文优化和完善用户问题`,
`, defaultPrompt2: `请输出一个优化后的问题。`,
systemDefault: '你是一个问题优化大师' systemDefault: '你是一个问题优化大师'
}, },
conditionNode: { conditionNode: {

View File

@ -47,7 +47,7 @@ export default {
}, },
datasetType: { datasetType: {
label: '知识库类型', label: '知识库类型',
generalInfo: '上传本地文件或手动录入', generalInfo: '上传本地文',
webInfo: '同步Web网站文本数据' webInfo: '同步Web网站文本数据'
}, },
source_url: { source_url: {

View File

@ -127,8 +127,8 @@ export default {
label: '問題優化', label: '問題優化',
text: '根據歷史聊天記錄優化完善當前問題,更利於匹配知識庫分段', text: '根據歷史聊天記錄優化完善當前問題,更利於匹配知識庫分段',
result: '問題優化結果', result: '問題優化結果',
defaultPrompt: `根據上下文優化和完善用戶問題:{{開始.question}} defaultPrompt1: `根據上下文優化和完善用戶問題:`,
`, defaultPrompt2: `請輸出一個優化後的問題。`,
systemDefault: '你是一個問題優化大師' systemDefault: '你是一個問題優化大師'
}, },
conditionNode: { conditionNode: {

View File

@ -56,6 +56,8 @@ export default {
references: ' (引用知識庫)', references: ' (引用知識庫)',
placeholder: '請輸入提示詞', placeholder: '請輸入提示詞',
requiredMessage: '請輸入提示詞', requiredMessage: '請輸入提示詞',
tooltip:'透過調整提示詞內容,可以引導大模型對話方向,該提示詞會被固定在上下文的開頭。',
noReferencesTooltip: noReferencesTooltip:
'透過調整提示詞內容,可以引導大模型對話方向,該提示詞會被固定在上下文的開頭。可以使用變數:{question} 是用戶提出問題的佔位符。', '透過調整提示詞內容,可以引導大模型對話方向,該提示詞會被固定在上下文的開頭。可以使用變數:{question} 是用戶提出問題的佔位符。',
referencesTooltip: referencesTooltip:

View File

@ -46,7 +46,7 @@ export default {
}, },
datasetType: { datasetType: {
label: '知識庫類型', label: '知識庫類型',
generalInfo: '上傳本地檔案或手動輸入', generalInfo: '上傳本地檔案',
webInfo: '同步Web網站文字資料' webInfo: '同步Web網站文字資料'
}, },
source_url: { source_url: {

View File

@ -19,7 +19,6 @@ const usePromptStore = defineStore({
localStorage.setItem('PROMPT_CACHE', JSON.stringify(this.$state)) localStorage.setItem('PROMPT_CACHE', JSON.stringify(this.$state))
}, },
get(user: string) { get(user: string) {
console.log(this.$state)
for (let i = 0; i < this.$state.length; i++) { for (let i = 0; i < this.$state.length; i++) {
if (this.$state[i].user === user) { if (this.$state[i].user === user) {
return this.$state[i].formValue return this.$state[i].formValue

View File

@ -512,7 +512,10 @@ const open = (data: any, content: any) => {
xpackForm.value.disclaimer = data.disclaimer xpackForm.value.disclaimer = data.disclaimer
xpackForm.value.disclaimer_value = data.disclaimer_value xpackForm.value.disclaimer_value = data.disclaimer_value
console.log(xpackForm.value.disclaimer_value) console.log(xpackForm.value.disclaimer_value)
if (xpackForm.value.disclaimer_value === '「以上内容均由AI生成仅供参考和借鉴」') { if (
xpackForm.value.disclaimer_value ===
t('views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue')
) {
xpackForm.value.disclaimer_value = t( xpackForm.value.disclaimer_value = t(
'views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue' 'views.applicationOverview.appInfo.SettingDisplayDialog.disclaimerValue'
) )

View File

@ -26,7 +26,6 @@
:placeholder="$t('common.search')" :placeholder="$t('common.search')"
prefix-icon="Search" prefix-icon="Search"
class="w-240" class="w-240"
style="margin-left: 10px"
clearable clearable
/> />
<div style="display: flex; align-items: center" class="float-right"> <div style="display: flex; align-items: center" class="float-right">

View File

@ -133,8 +133,8 @@
@change="list_model" @change="list_model"
style="width: 220px" style="width: 220px"
> >
<el-option :label="$t('views.template.templateForm.form.permissionType.public')" value="PUBLIC" /> <el-option :label="$t('common.public')" value="PUBLIC" />
<el-option :label="$t('views.template.templateForm.form.permissionType.private')" value="PRIVATE" /> <el-option :label="$t('common.private')" value="PRIVATE" />
</el-select> </el-select>
<el-select <el-select
v-else-if="search_type === 'model_type'" v-else-if="search_type === 'model_type'"

View File

@ -104,15 +104,15 @@ export const searchDatasetNode = {
} }
export const questionNode = { export const questionNode = {
type: WorkflowType.Question, type: WorkflowType.Question,
text: t('views.applicationWorkflow.nodes.searchDatasetNode.text'), text: t('views.applicationWorkflow.nodes.questionNode.text'),
label: t('views.applicationWorkflow.nodes.searchDatasetNode.label'), label: t('views.applicationWorkflow.nodes.questionNode.label'),
height: 345, height: 345,
properties: { properties: {
stepName: t('views.applicationWorkflow.nodes.searchDatasetNode.label'), stepName: t('views.applicationWorkflow.nodes.questionNode.label'),
config: { config: {
fields: [ fields: [
{ {
label: t('views.applicationWorkflow.nodes.searchDatasetNode.result'), label: t('views.applicationWorkflow.nodes.questionNode.result'),
value: 'answer' value: 'answer'
} }
] ]

View File

@ -176,7 +176,9 @@ const {
} = app.config.globalProperties.$route as any } = app.config.globalProperties.$route as any
// @ts-ignore // @ts-ignore
const defaultPrompt = t('views.applicationWorkflow.nodes.questionNode.defaultPrompt') const defaultPrompt = `${t('views.applicationWorkflow.nodes.questionNode.defaultPrompt1')}{{${t('views.applicationWorkflow.nodes.startNode.label')}.question}}
${t('views.applicationWorkflow.nodes.questionNode.defaultPrompt2')}`
const form = { const form = {
model_id: '', model_id: '',
system: t('views.applicationWorkflow.nodes.questionNode.systemDefault'), system: t('views.applicationWorkflow.nodes.questionNode.systemDefault'),