From 7e22b7b3663f778ee1e57e699b5d8809ab94a8e7 Mon Sep 17 00:00:00 2001 From: linwumingshi Date: Thu, 28 Aug 2025 17:02:33 +0800 Subject: [PATCH] feat(i18n): :sparkles: add new translations and update existing ones - Added new translations for various components and pages - Updated existing translations to improve accuracy and consistency - Improved internationalization support across the application --- front/src/utils/i18n/languages/en-us.js | 106 ++++++++++++++++++ front/src/utils/i18n/languages/zh-cn.js | 105 +++++++++++++++++ .../views/admin/setting/BaseSetting/index.vue | 63 ++++++----- .../views/admin/setting/DingDing/index.vue | 40 +++---- .../views/admin/setting/I18nSetting/index.vue | 53 ++++++--- front/src/views/admin/setting/WeCom/index.vue | 31 ++--- front/src/views/admin/setting/index.vue | 8 +- front/src/views/admin/template/index.vue | 51 +++++---- 8 files changed, 349 insertions(+), 108 deletions(-) diff --git a/front/src/utils/i18n/languages/en-us.js b/front/src/utils/i18n/languages/en-us.js index 478a6d56..d470b158 100644 --- a/front/src/utils/i18n/languages/en-us.js +++ b/front/src/utils/i18n/languages/en-us.js @@ -595,5 +595,111 @@ export default { settingTitle: 'MFA Setting', resetTitle: 'MFA Reseting', resetConfirm: 'Are you sure you want to reset the MFA certification? You need to scan the code again to obtain the new token.' + }, + SystemSetting: { + 'basicConfig': 'Basic Configuration', + 'internationalizationConfig': 'Internationalization', + 'dingdingConfig': 'DingTalk Configuration', + 'weComConfig': 'WeCom Configuration' + }, + BasicConfig: { + 'tornaFrontUrl': 'Torna Frontend URL', + 'regEnable': 'Allow Registration', + 'allow': 'Allow', + 'MFA': 'MFA Authentication', + 'enable': 'Enable', + 'docSortRule': 'Document Sort Rule', + 'sortByOrderIndex': 'Sort by Order Field', + 'sortByName': 'Sort by Document Name', + 'sortByUrl': 'Sort by URL', + 'imageUploadSetting': 'Image Upload Setting', + 'uploadDirLabel': 'Upload Directory', + 'uploadDirPlaceholder': 'Absolute path, e.g.: /opt/upload, default is {user.home}/torna_upload if empty', + 'customDomainLabel': 'Custom Domain', + 'customDomainPlaceholder': 'e.g.: http://images.xxx.com or http://images.xxx.com/upload', + 'useMeterSphere': 'Use MeterSphere', + 'tornaFrontUrlRemark': 'Torna frontend URL', + 'uploadDirRemark': 'Upload file storage directory', + 'uploadDomainRemark': 'Upload file mapping', + 'msEnableRemark': 'Enable MeterSphere integration', + 'MFARemark': 'Enable MFA authentication', + 'docSortRuleRemark': 'Document sort rule', + 'uploadDir': 'Upload Directory', + 'customDomain': 'Custom Domain', + 'apifoxImportUrl': 'Apifox Import URL', + 'apifoxToken': 'Apifox Token', + 'license': 'License', + 'validUntil': 'Valid Until', + 'mcpQueryAllDocs': 'MCP Query All Documents', + 'mcpQueryAllDocsTip': 'Allow: MCP client can query all documents; Deny: Only query documents with permission' + }, + Internationalization: { + 'defaultLang': 'Default Language', + 'defaultLangTip': 'The language displayed to new users upon first login', + 'addI18n': 'Add Language', + 'langCode': 'Language Code', + 'langCodeTip1': 'Suggested to be consistent with ElementUI language code, ', + 'langCodeTip2': 'Built-in zh-CN (Chinese) and en (English) are available, you can override them here. Use zh-CN to override Chinese.', + 'viewLink': 'View', + 'langCodePlaceholder': 'Language code, e.g.: zh-TW', + 'langDesc': 'Language Description', + 'langDescPlaceholder': 'Description, e.g.: Traditional Chinese', + 'translationContent': 'Translation Content', + 'translationTip1': 'JSON content, keep keys unchanged, translate values only. {0} is placeholder and should not be translated. After saving, go to ' + }, + DingDing: { + 'appKey': 'DingTalk AppKey', + 'appKeyPlaceholder': 'AppKey', + 'appKeyRemark': 'DingTalk AppKey', + 'appSecret': 'DingTalk AppSecret', + 'appSecretPlaceholder': 'AppSecret', + 'appSecretRemark': 'DingTalk AppSecret', + 'messageTemplate': 'DingTalk Message Template', + 'messageTemplatePlaceholder': 'DingTalk message template', + 'messageTemplateRemark': 'DingTalk message push template', + 'placeholderTip': '{xx} is a placeholder, will be replaced with actual value. Variables:', + 'modifyType': 'Modify type, values: modify, delete', + 'projectName': 'Project Name', + 'appName': 'Application Name', + 'releaseNo': 'Release No', + 'docName': 'Document Name', + 'modifier': 'Modifier', + 'modifyTime': 'Modify Time', + 'docViewUrl': 'Document Preview URL', + 'atUserTip': '@user, all subscribers will be mentioned. Prerequisite: bind DingTalk account in [User Center] - [Account Info]' + }, + WeCom: { + 'messageTemplate': 'WeCom Message Template', + 'messageTemplatePlaceholder': 'WeCom message template', + 'messageTemplateRemark': 'WeCom message push template', + 'placeholderTip': '{xx} is a placeholder, will be replaced with actual value. Variables:', + 'modifyType': 'Modify type, values: modify, delete', + 'projectName': 'Project Name', + 'appName': 'Application Name', + 'releaseNo': 'Release No', + 'docName': 'Document Name', + 'modifier': 'Modifier', + 'modifyTime': 'Modify Time', + 'docViewUrl': 'Document Preview URL', + 'atUserTip': '@user, all subscribers will be mentioned. Prerequisite: fill WeCom mobile number in [User Center] - [Account Info]' + }, + CodeGenTemplate: { + 'addTemplate': 'Add Template', + 'codeGenTitle': 'Code Generation Template', + 'howToUse': 'How to Use', + 'tipText': 'Go to document preview page, click the "Generate Code" icon in the top right corner', + 'howToUseLink': 'How to use after adding', + 'templateName': 'Template Name', + 'group': 'Group', + 'groupPlaceholder': 'Input to create new group, leave empty for default group', + 'templateContent': 'Template Content', + 'velocityTip': 'Based on Velocity, ', + 'syntaxRef': 'Syntax Reference', + 'exampleTemplates': 'Example Templates (click to insert)', + 'javaClass': 'Java Class', + 'curl': 'curl', + 'vueTable': 'VUE Table', + 'velocityVars': 'Velocity Variables', + 'clickToInsert': 'Click variable to insert' } } diff --git a/front/src/utils/i18n/languages/zh-cn.js b/front/src/utils/i18n/languages/zh-cn.js index 0a587572..5401e6e7 100644 --- a/front/src/utils/i18n/languages/zh-cn.js +++ b/front/src/utils/i18n/languages/zh-cn.js @@ -598,5 +598,110 @@ export default { settingTitle: 'MFA配置', resetTitle: 'MFA重置', resetConfirm: '确定要重置MFA认证吗?您需要重新扫码获取新的令牌。' + }, + SystemSetting: { + 'basicConfig': '基本配置', + 'internationalizationConfig': '国际化配置', + 'dingdingConfig': '钉钉配置', + 'weComConfig': '企业微信配置' + }, + BasicConfig: { + 'tornaFrontUrl': 'Torna根地址', + 'regEnable': '允许注册', + 'allow': '允许', + 'MFA': 'MFA认证', + 'enable': '开启', + 'docSortRule': '文档排序规则', + 'sortByOrderIndex': '根据排序字段排序', + 'sortByName': '根据文档名称排序', + 'sortByUrl': '根据URL排序', + 'imageUploadSetting': '图片上传设置', + 'uploadDirLabel': '上传文件存放目录', + 'uploadDirPlaceholder': '绝对路径,如:/opt/upload 不填默认在 {user.home}/torna_upload 下', + 'customDomainLabel': '自定义域名', + 'customDomainPlaceholder': '如:http://images.xxx.com、http://images.xxx.com/upload', + 'useMeterSphere': '使用 MeterSphere', + 'tornaFrontUrlRemark': 'Torna前端地址', + 'uploadDirRemark': '上传文件保存目录', + 'uploadDomainRemark': '上传文件映射', + 'msEnableRemark': '开启MeterSphere对接', + 'MFARemark': '开启MFA认证', + 'docSortRuleRemark': '文档排序规则', + 'uploadDir': '上传目录', + 'customDomain': '自定义域名', + 'apifoxImportUrl': 'Apifox 导入地址', + 'apifoxToken': 'Apifox Token', + 'license': '许可证', + 'validUntil': '有效期至', + 'mcpQueryAllDocs': 'MCP 查询全部文档', + 'mcpQueryAllDocsTip': '允许:MCP客户端可查询所有文档;拒绝:仅能查询有权限的文档' + }, + Internationalization: { + 'defaultLang': '系统默认语言', + 'defaultLangTip': '新用户第一次进入系统所显示的语言', + 'addI18n': '添加国际化', + 'langCode': '语言简称', + 'langCodeTip1': '建议跟ElementUI简称保持一致,', + 'langCodeTip2': '系统内置了zh-CN(简体中文),en(英文)两个配置,可在此进行覆盖,如要覆盖简体中文填zh-CN', + 'viewLink': '点击查看', + 'langCodePlaceholder': '语言简称,如:zh-TW', + 'langDesc': '语言描述', + 'langDescPlaceholder': '语言描述,如:繁体中文', + 'translationContent': '翻译内容', + 'translationTip1': 'json内容,key不变,翻译value值,{0}为占位符不用翻译。完成后前往' + }, + DingDing: { + 'appKey': '钉钉appKey', + 'appKeyPlaceholder': 'appKey', + 'appKeyRemark': '钉钉appKey', + 'appSecret': '钉钉appSecret', + 'appSecretPlaceholder': 'appSecret', + 'appSecretRemark': '钉钉appSecret', + 'messageTemplate': '钉钉消息推送模板', + 'messageTemplatePlaceholder': '钉钉消息推送模板', + 'messageTemplateRemark': '钉钉消息推送模板', + 'placeholderTip': '{xx}为变量占位符,消息推送将替换成实际内容,变量说明:', + 'modifyType': '修改类型,枚举值:修改,删除', + 'projectName': '项目名称', + 'appName': '应用名称', + 'releaseNo': '版本号', + 'docName': '文档名称', + 'modifier': '修改人', + 'modifyTime': '修改时间', + 'docViewUrl': '文档预览地址', + 'atUserTip': '@用户,关注此文档的人都会被at,前提:前往[个人中心]-[账号信息]绑定钉钉账号' + }, + WeCom: { + 'messageTemplate': '企业微信消息推送模板', + 'messageTemplatePlaceholder': '企业微信消息推送模板', + 'messageTemplateRemark': '企业微信消息推送模板', + 'placeholderTip': '{xx}为变量占位符,消息推送将替换成实际内容,变量说明:', + 'modifyType': '修改类型,枚举值:修改,删除', + 'projectName': '项目名称', + 'appName': '应用名称', + 'releaseNo': '版本号', + 'docName': '文档名称', + 'modifier': '修改人', + 'modifyTime': '修改时间', + 'docViewUrl': '文档预览地址', + 'atUserTip': '@用户,关注此文档的人都会被at,前提:前往[个人中心]-[账号信息]填写企业微信手机号码' + }, + CodeGenTemplate: { + 'addTemplate': '添加模板', + 'codeGenTitle': '代码生成模板', + 'howToUse': '如何使用', + 'tipText': '前往文档预览页,点击右上角生成代码图标', + 'howToUseLink': '添加后如何使用', + 'templateName': '模板名称', + 'group': '分组', + 'groupPlaceholder': '输入可新建分组,不填为默认分组', + 'templateContent': '模板内容', + 'velocityTip': '基于Velocity,', + 'syntaxRef': '参考语法', + 'exampleTemplates': '示例模板(点击插入)', + 'javaClass': 'Java类', + 'vueTable': 'VUE表格', + 'velocityVars': 'Velocity变量', + 'clickToInsert': '点击变量直接插入' } } diff --git a/front/src/views/admin/setting/BaseSetting/index.vue b/front/src/views/admin/setting/BaseSetting/index.vue index 426aad43..d787d9d8 100644 --- a/front/src/views/admin/setting/BaseSetting/index.vue +++ b/front/src/views/admin/setting/BaseSetting/index.vue @@ -1,63 +1,66 @@