From dedc8c00ce50e26686361a23cd5c12fc8cbb38fa Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 21 Jan 2025 16:18:05 +0800 Subject: [PATCH] feat: i18n --- ui/src/locales/lang/en-US/ai-chat.ts | 70 ++++++++++++++++++- ui/src/locales/lang/en-US/views/dataset.ts | 23 ++++++- ui/src/locales/lang/en-US/views/index.ts | 57 ++++++++-------- ui/src/locales/lang/en-US/views/login.ts | 24 ++++++- ui/src/locales/lang/zh-Hant/ai-chat.ts | 71 +++++++++++++++++++- ui/src/locales/lang/zh-Hant/views/dataset.ts | 22 +++++- ui/src/locales/lang/zh-Hant/views/index.ts | 57 ++++++++-------- ui/src/locales/lang/zh-Hant/views/login.ts | 24 ++++++- 8 files changed, 281 insertions(+), 67 deletions(-) diff --git a/ui/src/locales/lang/en-US/ai-chat.ts b/ui/src/locales/lang/en-US/ai-chat.ts index 3a5ef132e..d581b1599 100644 --- a/ui/src/locales/lang/en-US/ai-chat.ts +++ b/ui/src/locales/lang/en-US/ai-chat.ts @@ -7,26 +7,92 @@ export default { exportRecords: 'Export Chat Records', chatId: 'Chat ID', userInput: 'User Input', + quote: 'Quote', + download: 'Click to Download File', passwordValidator: { title: 'Enter password to open the link', errorMessage1: 'Password cannot be empty', errorMessage2: 'Incorrect password' }, + operation: { + play: 'Click to Play', + pause: 'Stop', + regeneration: 'Regenerate Answer', + like: 'Like', + cancelLike: 'Cancel Like', + oppose: 'Dislike', + cancelOppose: 'Cancel Dislike', + continue: 'Continue', + stopChat: 'Stop Answering' + }, tip: { error500Message: 'Sorry, the service is currently under maintenance. Please try again later!', errorIdentifyMessage: 'Unable to identify user', errorLimitMessage: - 'Sorry, you have reached the maximum number of questions. Please try again tomorrow!' + 'Sorry, you have reached the maximum number of questions. Please try again tomorrow!', + answerMessage: + 'Sorry, no relevant content was found. Please rephrase your question or provide more information.', + stopAnswer: 'Answering stopped', + answerLoading: 'Answering', + recorderTip: `

This feature requires the use of a microphone. Browsers prohibit recording on insecure pages. Solutions are as follows:
+1. Enable HTTPS to resolve;
+2. If there is no HTTPS configuration, modify the browser security settings. Chrome settings as follows:
+(1) Enter chrome://flags/#unsafely-treat-insecure-origin-as-secure in the address bar;
+(2) Add the HTTP site to the text box, e.g., http://127.0.0.1:8080.

`, + recorderError: 'Recording failed', + confirm: 'I understand', + requiredMessage: 'Please fill in all required fields', + inputParamMessage1: 'Please enter parameters in the URL', + inputParamMessage2: 'value', + prologueMessage: 'Sorry, the service is currently under maintenance. Please try again later!' + }, + inputPlaceholder: { + speaking: 'Speaking', + recorderLoading: 'Transcribing', + default: 'Enter your question, Ctrl+Enter for new line, Enter to send' + }, + uploadFile: { + label: 'Upload File', + most: 'Up to', + limit: 'files, each file limited to', + fileType: 'File Type', + tipMessage: 'Please select file types in the file upload configuration', + limitMessage1: 'Up to', + limitMessage2: 'files', + sizeLimit: 'Each file size cannot exceed', + imageMessage: 'Please parse the image content', + errorMessage: 'Upload failed' }, executionDetails: { title: 'Execution Details', paramInput: 'Parameter Input', - paramOutput: 'Parameter Output' + paramOutput: 'Parameter Output', + paramOutputTooltip: 'Each document supports preview of up to 500 characters', + audioFile: 'Audio File', + searchContent: 'Search Content', + searchResult: 'Search Results', + conditionResult: 'Condition Result', + currentChat: 'Current Conversation', + answer: 'AI Response', + replyContent: 'Reply Content', + textContent: 'Text Content', + input: 'Input', + output: 'Output', + rerankerContent: 'Reranked Content', + rerankerResult: 'Reranked Results', + paragraph: 'Paragraph', + noSubmit: 'User did not submit', + errMessage: 'Error Log' }, KnowledgeSource: { title: 'Knowledge Source', referenceParagraph: 'Referenced Paragraph', consume: 'Consumption', consumeTime: 'Time Consumed' + }, + paragraphSource: { + title: 'Knowledge Base Reference', + question: 'User Question', + optimizationQuestion: 'Optimized Question' } } diff --git a/ui/src/locales/lang/en-US/views/dataset.ts b/ui/src/locales/lang/en-US/views/dataset.ts index 85952f9d6..9be56c132 100644 --- a/ui/src/locales/lang/en-US/views/dataset.ts +++ b/ui/src/locales/lang/en-US/views/dataset.ts @@ -58,6 +58,27 @@ export default { label: 'Selector', placeholder: 'Default is body, can input .classname/#idname/tagname' } - }, + } + }, + ResultSuccess: { + title: 'Knowledge Base Created Successfully', + paragraph: 'Paragraphs', + paragraph_count: 'Paragraphs', + documentList: 'Document List', + loading: 'Importing', + buttons: { + toDataset: 'Return to Knowledge Base List', + toDocument: 'Go to Document' + } + }, + syncWeb: { + title: 'Sync Knowledge Base', + syncMethod: 'Sync Method', + replace: 'Replace Sync', + replaceText: 'Re-fetch Web site documents, replacing the documents in the local knowledge base', + complete: 'Full Sync', + completeText: + 'Delete all documents in the local knowledge base and re-fetch Web site documents', + tip: 'Note: All syncs will delete existing data and re-fetch new data. Please proceed with caution.' } } diff --git a/ui/src/locales/lang/en-US/views/index.ts b/ui/src/locales/lang/en-US/views/index.ts index 9db8a9cd5..4ec71b023 100644 --- a/ui/src/locales/lang/en-US/views/index.ts +++ b/ui/src/locales/lang/en-US/views/index.ts @@ -1,31 +1,32 @@ import notFound from './404' -import application from './application'; -import applicationOverview from './application-overview'; -import dataset from './dataset'; -import system from './system'; -import functionLib from './function-lib'; -import user from './user'; -import team from './team'; -import template from './template'; -import document from './document'; -import paragraph from './paragraph'; -import problem from './problem'; -import log from './log'; -import applicationWorkflow from './application-workflow'; - +import application from './application' +import applicationOverview from './application-overview' +import dataset from './dataset' +import system from './system' +import functionLib from './function-lib' +import user from './user' +import team from './team' +import template from './template' +import document from './document' +import paragraph from './paragraph' +import problem from './problem' +import log from './log' +import applicationWorkflow from './application-workflow' +import login from './login' export default { - notFound, - application, - applicationOverview, - system, - functionLib, - user, - team, - template, - dataset, - applicationWorkflow, - document, - paragraph, - problem, - log, + notFound, + application, + applicationOverview, + system, + functionLib, + user, + team, + template, + dataset, + applicationWorkflow, + document, + paragraph, + problem, + log, + login } diff --git a/ui/src/locales/lang/en-US/views/login.ts b/ui/src/locales/lang/en-US/views/login.ts index b428478d4..f6033ef2b 100644 --- a/ui/src/locales/lang/en-US/views/login.ts +++ b/ui/src/locales/lang/en-US/views/login.ts @@ -1,4 +1,24 @@ export default { - jump_tip: 'Jumping to the authentication source page for authentication', - jump: 'Jump' + title: 'Login', + jump_tip: 'You will be redirected to the authentication source page for authentication', + jump: 'Redirect', + resetPassword: 'Reset Password', + forgotPassword: 'Forgot Password', + userRegister: 'User Registration', + buttons: { + login: 'Login', + register: 'Register', + backLogin: 'Back to Login', + checkCode: 'Verify Now' + }, + newPassword: 'New Password', + enterPassword: 'Please enter your new password', + useEmail: 'Use Email', + moreMethod: 'More Login Methods', + verificationCode: { + placeholder: 'Please enter the verification code', + getVerificationCode: 'Get Verification Code', + successMessage: 'Verification code sent successfully', + resend: 'Resend' + } } diff --git a/ui/src/locales/lang/zh-Hant/ai-chat.ts b/ui/src/locales/lang/zh-Hant/ai-chat.ts index 07eb962e3..e5faa5c44 100644 --- a/ui/src/locales/lang/zh-Hant/ai-chat.ts +++ b/ui/src/locales/lang/zh-Hant/ai-chat.ts @@ -7,25 +7,90 @@ export default { exportRecords: '導出聊天記錄', chatId: '對話ID', userInput: '用戶輸入', + quote: '引用', + download: '點擊下載文件', passwordValidator: { title: '請輸入密碼打開連結', errorMessage1: '密碼不能為空', errorMessage2: '密碼錯誤' }, + operation: { + play: '點擊播放', + pause: '停止', + regeneration: '換個答案', + like: '贊同', + cancelLike: '取消贊同', + oppose: '反對', + cancelOppose: '取消反對', + continue: '繼續', + stopChat: '停止回答' + }, tip: { error500Message: '抱歉,當前正在維護,無法提供服務,請稍後再試!', errorIdentifyMessage: '無法識別用戶身份', - errorLimitMessage: '抱歉,您的提問已達最大限制,請明天再來吧!' + errorLimitMessage: '抱歉,您的提問已達最大限制,請明天再來吧!', + answerMessage: '抱歉,沒有查找到相關內容,請重新描述您的問題或提供更多資訊。', + stopAnswer: '已停止回答', + answerLoading: '回答中', + recorderTip: `

該功能需要使用麥克風,瀏覽器禁止不安全頁面錄音,解決方案如下:
+1、可開啟 https 解決;
+2、若無 https 配置則需要修改瀏覽器安全配置,Chrome 設定如下:
+(1) 地址欄輸入 chrome://flags/#unsafely-treat-insecure-origin-as-secure;
+(2) 將 http 站點配置在文字框中,例如: http://127.0.0.1:8080。

`, + recorderError: '錄音失敗', + confirm: '我知道了', + requiredMessage: '請填寫所有必填欄位', + inputParamMessage1: '請在 URL 中填寫參數', + inputParamMessage2: '的值', + prologueMessage: '抱歉,當前正在維護,無法提供服務,請稍後再試!' + }, + inputPlaceholder: { + speaking: '說話中', + recorderLoading: '轉文字中', + default: '請輸入問題,Ctrl+Enter 換行,Enter 發送' + }, + uploadFile: { + label: '上傳文件', + most: '最多', + limit: '個,每個文件限制', + fileType: '文件類型', + tipMessage: '請在文件上傳配置中選擇文件類型', + limitMessage1: '最多上傳', + limitMessage2: '個文件', + sizeLimit: '單個文件大小不能超過', + imageMessage: '請解析圖片內容', + errorMessage: '上傳失敗' }, executionDetails: { title: '執行詳細', paramInput: '參數輸入', - paramOutput: '參數輸出' + paramOutput: '參數輸出', + paramOutputTooltip: '每個文件僅支持預覽 500 字', + audioFile: '語音文件', + searchContent: '檢索內容', + searchResult: '檢索結果', + conditionResult: '判斷結果', + currentChat: '本次對話', + answer: 'AI 回答', + replyContent: '回覆內容', + textContent: '文本內容', + input: '輸入', + output: '輸出', + rerankerContent: '重排內容', + rerankerResult: '重排結果', + paragraph: '段落', + noSubmit: '用戶未提交', + errMessage: '錯誤日誌' }, KnowledgeSource: { title: '知識來源', - referenceParagraph: '引用分段', + referenceParagraph: '引用段落', consume: '消耗', consumeTime: '耗時' + }, + paragraphSource: { + title: '知識庫引用', + question: '用戶問題', + optimizationQuestion: '優化後問題' } } diff --git a/ui/src/locales/lang/zh-Hant/views/dataset.ts b/ui/src/locales/lang/zh-Hant/views/dataset.ts index 8d4417e47..d3105da6a 100644 --- a/ui/src/locales/lang/zh-Hant/views/dataset.ts +++ b/ui/src/locales/lang/zh-Hant/views/dataset.ts @@ -56,6 +56,26 @@ export default { label: '選擇器', placeholder: '預設為 body,可輸入 .classname/#idname/tagname' } - }, + } + }, + ResultSuccess: { + title: '知識庫建立成功', + paragraph: '段落', + paragraph_count: '個段落', + documentList: '文件列表', + loading: '正在導入', + buttons: { + toDataset: '返回知識庫列表', + toDocument: '前往文件' + } + }, + syncWeb: { + title: '同步知識庫', + syncMethod: '同步方式', + replace: '替換同步', + replaceText: '重新獲取 Web 站點文件,覆蓋替換本地知識庫中的文件', + complete: '完整同步', + completeText: '先刪除本地知識庫所有文件,重新獲取 Web 站點文件', + tip: '注意:所有同步都會刪除現有數據並重新獲取新數據,請謹慎操作。' } } diff --git a/ui/src/locales/lang/zh-Hant/views/index.ts b/ui/src/locales/lang/zh-Hant/views/index.ts index 9db8a9cd5..4ec71b023 100644 --- a/ui/src/locales/lang/zh-Hant/views/index.ts +++ b/ui/src/locales/lang/zh-Hant/views/index.ts @@ -1,31 +1,32 @@ import notFound from './404' -import application from './application'; -import applicationOverview from './application-overview'; -import dataset from './dataset'; -import system from './system'; -import functionLib from './function-lib'; -import user from './user'; -import team from './team'; -import template from './template'; -import document from './document'; -import paragraph from './paragraph'; -import problem from './problem'; -import log from './log'; -import applicationWorkflow from './application-workflow'; - +import application from './application' +import applicationOverview from './application-overview' +import dataset from './dataset' +import system from './system' +import functionLib from './function-lib' +import user from './user' +import team from './team' +import template from './template' +import document from './document' +import paragraph from './paragraph' +import problem from './problem' +import log from './log' +import applicationWorkflow from './application-workflow' +import login from './login' export default { - notFound, - application, - applicationOverview, - system, - functionLib, - user, - team, - template, - dataset, - applicationWorkflow, - document, - paragraph, - problem, - log, + notFound, + application, + applicationOverview, + system, + functionLib, + user, + team, + template, + dataset, + applicationWorkflow, + document, + paragraph, + problem, + log, + login } diff --git a/ui/src/locales/lang/zh-Hant/views/login.ts b/ui/src/locales/lang/zh-Hant/views/login.ts index c4cc2f396..dded54730 100644 --- a/ui/src/locales/lang/zh-Hant/views/login.ts +++ b/ui/src/locales/lang/zh-Hant/views/login.ts @@ -1,4 +1,24 @@ export default { - jump_tip: '即將跳轉至認證來源頁面進行認證', - jump: '跳轉' + title: '普通登錄', + jump_tip: '即將跳轉至認證源頁面進行認證', + jump: '跳轉', + resetPassword: '修改密碼', + forgotPassword: '忘記密碼', + userRegister: '用戶註冊', + buttons: { + login: '登錄', + register: '註冊', + backLogin: '返回登錄', + checkCode: '立即驗證' + }, + newPassword: '新密碼', + enterPassword: '請輸入新密碼', + useEmail: '使用電子郵箱', + moreMethod: '更多登錄方式', + verificationCode: { + placeholder: '請輸入驗證碼', + getVerificationCode: '獲取驗證碼', + successMessage: '驗證碼發送成功', + resend: '重新發送' + } }