Skip to content

Commit

Permalink
🌐 style: update i18n (lobehub#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Aug 29, 2023
1 parent 3f60b50 commit 3bf1509
Show file tree
Hide file tree
Showing 10 changed files with 224 additions and 53 deletions.
10 changes: 7 additions & 3 deletions locales/en_US/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"regenerate": "Regenerate",
"rename": "Rename",
"reset": "Reset",
"retry": "Retry",
"roleAndArchive": "Roles and Archives",
"searchAgentPlaceholder": "Search Assistants and Conversations...",
"send": "Send",
Expand All @@ -61,7 +62,8 @@
"stop": "Stop",
"tab": {
"chat": "Chat",
"market": "Assistant Market"
"market": "Assistant Market",
"setting": "Settings"
},
"temp": "Temporary",
"tokenDetail": "Role Setting: {{systemRoleToken}} · Message History: {{chatsToken}}",
Expand All @@ -74,8 +76,10 @@
"confirmRemoveTopic": "You are about to delete this topic. Once deleted, it cannot be recovered. Please proceed with caution.",
"defaultTitle": "Default Topic",
"saveCurrentMessages": "Save the current session as a topic",
"searchPlaceholder": "Search Topics..."
"searchPlaceholder": "Search Topics...",
"title": "Topic"
},
"updateAgent": "Update Assistant Information",
"updatePrompt": "Update Prompts"
"updatePrompt": "Update Prompts",
"warp": "Line break"
}
16 changes: 15 additions & 1 deletion locales/en_US/error.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"pluginSettings": {
"desc": "Complete the following configuration to start using this plugin",
"title": "{{name}} Plugin Configuration"
},
"response": {
"400": "Sorry, the server does not understand your request. Please make sure your request parameters are correct.",
"401": "Sorry, the server has rejected your request, possibly due to insufficient permissions or invalid authentication.",
Expand All @@ -11,7 +15,17 @@
"503": "Sorry, the server is currently unable to process your request, possibly due to overload or maintenance. Please try again later.",
"504": "Sorry, the server did not receive a response from the upstream server. Please try again later.",
"InvalidAccessCode": "The password is incorrect or empty. Please enter the correct access password or add a custom OpenAI API Key.",
"OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information."
"OpenAIBizError": "Error requesting OpenAI service. Please troubleshoot or retry based on the following information.",
"PluginMarketIndexNotFound": "Sorry, the server could not find the plugin index. Please check if the index address is correct",
"PluginMarketIndexInvalid": "Sorry, the plugin index validation failed. Please check if the index file format is correct",
"PluginMetaNotFound": "Sorry, the plugin was not found in the index. Please check the plugin's configuration information in the index",
"PluginMetaInvalid": "Sorry, the plugin's metadata validation failed. Please check if the plugin metadata format is correct",
"PluginManifestNotFound": "Sorry, the server could not find the plugin's manifest file (manifest.json). Please check if the plugin manifest file address is correct",
"PluginManifestInvalid": "Sorry, the plugin's manifest validation failed. Please check if the manifest format is correct",
"PluginApiNotFound": "Sorry, the API does not exist in the plugin's manifest. Please check if your request method matches the plugin manifest API",
"PluginApiParamsError": "Sorry, the input parameter validation for the plugin request failed. Please check if the input parameters match the API description",
"PluginSettingsInvalid": "This plugin needs to be correctly configured before it can be used. Please check if your configuration is correct",
"PluginServerError": "Plugin server request returned an error. Please check your plugin manifest file, plugin configuration, or server implementation based on the error information below"
},
"unlock": {
"apikey": {
Expand Down
80 changes: 79 additions & 1 deletion locales/en_US/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,83 @@
"function_call": "Function Call",
"response": "Response"
},
"dev": {
"confirmDeleteDevPlugin": "Are you sure you want to delete this local plugin? Once deleted, it cannot be recovered.",
"deleteSuccess": "Plugin deleted successfully",
"manifest": {
"identifier": {
"desc": "The unique identifier of the plugin",
"label": "Identifier"
},
"mode": {
"local": "Visual Configuration",
"local-tooltip": "Visual configuration is not supported at the moment",
"url": "Online Link"
},
"name": {
"desc": "The title of the plugin",
"label": "Title",
"placeholder": "Search Engine"
}
},
"meta": {
"author": {
"desc": "The author of the plugin",
"label": "Author"
},
"avatar": {
"desc": "The icon of the plugin, can be an Emoji or a URL",
"label": "Icon"
},
"description": {
"desc": "The description of the plugin",
"label": "Description",
"placeholder": "Get information from search engines"
},
"formFieldRequired": "This field is required",
"homepage": {
"desc": "The homepage of the plugin",
"label": "Homepage"
},
"identifier": {
"desc": "The unique identifier of the plugin, only supports alphanumeric characters, hyphen -, and underscore _",
"errorDuplicate": "The identifier is already used by another plugin, please modify the identifier",
"label": "Identifier",
"pattenErrorMessage": "Only alphanumeric characters, hyphen -, and underscore _ are allowed"
},
"manifest": {
"desc": "LobeChat will install the plugin using this link",
"invalid": "The input manifest link is invalid or does not comply with the specification",
"label": "Plugin Manifest URL",
"urlError": "Please enter a valid URL"
},
"title": {
"desc": "The title of the plugin",
"label": "Title",
"placeholder": "Search Engine"
}
},
"metaConfig": "Plugin metadata configuration",
"modalDesc": "After adding a custom plugin, it can be used for plugin development verification or directly in conversations. Please refer to the plugin development documentation for more information.",
"preview": {
"card": "Preview of plugin display",
"desc": "Preview of plugin description",
"title": "Plugin Name Preview"
},
"save": "Save",
"saveSuccess": "Plugin settings saved successfully",
"tabs": {
"manifest": "Function Description Manifest (Manifest)",
"meta": "Plugin Metadata"
},
"title": "Add Custom Plugin"
},
"list": {
"item": {
"local.config": "Configuration",
"local.title": "Local"
}
},
"loading": {
"content": "Loading...",
"plugin": "Plugin is running..."
Expand All @@ -13,7 +90,8 @@
"realtimeWeather": "Realtime Weather",
"searchEngine": "Search Engine",
"undefined": "Plugin Detection...",
"websiteCrawler": "Website Crawler"
"websiteCrawler": "Website Crawler",
"unknown": "Plugin detection in progress..."
},
"realtimeWeather": {
"data": {
Expand Down
5 changes: 4 additions & 1 deletion locales/en_US/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@
}
},
"settingPlugin": {
"title": "Plugin List"
"title": "Plugin List",
"add": "Add",
"addTooltip": "Add custom plugin",
"config": "{{id}} Plugin Configuration"
},
"settingSystem": {
"accessCode": {
Expand Down
10 changes: 7 additions & 3 deletions locales/zh_CN/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
"regenerate": "重新生成",
"rename": "重命名",
"reset": "重置",
"retry": "重试",
"roleAndArchive": "角色与记录",
"searchAgentPlaceholder": "搜索助手和对话...",
"send": "发送",
Expand All @@ -61,7 +62,8 @@
"stop": "停止",
"tab": {
"chat": "会话",
"market": "助手市场"
"market": "发现",
"setting": "设置"
},
"temp": "临时",
"tokenDetail": "角色设定: {{systemRoleToken}} · 历史消息: {{chatsToken}}",
Expand All @@ -74,8 +76,10 @@
"confirmRemoveTopic": "即将删除该话题,删除后将不可恢复,请谨慎操作。",
"defaultTitle": "默认话题",
"saveCurrentMessages": "将当前会话保存为话题",
"searchPlaceholder": "搜索话题..."
"searchPlaceholder": "搜索话题...",
"title": "话题"
},
"updateAgent": "更新助理信息",
"updatePrompt": "更新提示词"
"updatePrompt": "更新提示词",
"warp": "换行"
}
14 changes: 14 additions & 0 deletions locales/zh_CN/error.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
{
"pluginSettings": {
"desc": "完成以下配置,即可开始使用该插件",
"title": "{{name}}插件配置"
},
"response": {
"400": "很抱歉,服务器不明白您的请求,请确认您的请求参数是否正确",
"401": "很抱歉,服务器拒绝了您的请求,可能是因为您的权限不足或未提供有效的身份验证",
Expand All @@ -10,6 +14,16 @@
"502": "很抱歉,服务器似乎迷失了方向,暂时无法提供服务,请稍后再试",
"503": "很抱歉,服务器当前无法处理您的请求,可能是由于过载或正在进行维护,请稍后再试",
"504": "很抱歉,服务器没有等到上游服务器的回应,请稍后再试",
"PluginMarketIndexNotFound": "很抱歉,服务器没有找到插件索引,请检查索引地址是否正确",
"PluginMarketIndexInvalid": "很抱歉,插件索引校验未通过,请检查索引文件格式是否规范",
"PluginMetaNotFound": "很抱歉,没有在索引中发现该插件,请插件在索引中的配置信息",
"PluginMetaInvalid": "很抱歉,该插件的元信息校验未通过,请检查插件元信息格式是否规范",
"PluginManifestNotFound": "很抱歉,服务器没有找到该插件的描述清单 (manifest.json),请检查插件描述文件地址是否正确",
"PluginManifestInvalid": "很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范",
"PluginApiNotFound": "很抱歉,插件描述清单中不存在该 API ,请检查你的请求方法与插件清单 API 是否匹配",
"PluginApiParamsError": "很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配",
"PluginSettingsInvalid": "该插件需要正确配置后才可以使用,请检查你的配置是否正确",
"PluginServerError": "插件服务端请求返回出错,请检查根据下面的报错信息检查你的插件描述文件、插件配置或服务端实现",
"InvalidAccessCode": "密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key",
"OpenAIBizError": "请求 OpenAI 服务出错,请根据以下信息排查或重试"
},
Expand Down
99 changes: 79 additions & 20 deletions locales/zh_CN/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,30 +4,89 @@
"function_call": "函数调用",
"response": "返回结果"
},
"dev": {
"confirmDeleteDevPlugin": "即将删除该本地插件,删除后将无法找回,是否删除该插件?",
"deleteSuccess": "插件删除成功",
"manifest": {
"identifier": {
"desc": "插件的唯一标识",
"label": "标识符"
},
"mode": {
"local": "可视化配置",
"local-tooltip": "暂时不支持可视化配置",
"url": "在线链接"
},
"name": {
"desc": "插件标题",
"label": "标题",
"placeholder": "搜索引擎"
}
},
"meta": {
"author": {
"desc": "插件的作者",
"label": "作者"
},
"avatar": {
"desc": "插件的图标,可以使用 Emoji,也可以使用 URL",
"label": "图标"
},
"description": {
"desc": "插件描述",
"label": "描述",
"placeholder": "查询搜索引擎获取信息"
},
"formFieldRequired": "该字段为必填项",
"homepage": {
"desc": "插件的首页",
"label": "首页"
},
"identifier": {
"desc": "插件的唯一标识,仅支持英文字符、数字、破折号 - 、下划线 _",
"errorDuplicate": "标识符和已有插件重复,请修改标识符",
"label": "标识符",
"pattenErrorMessage": "只能输入英文字符、数字 、- 和_ 这两个符号"
},
"manifest": {
"desc": "LobeChat 将会通过该链接安装插件",
"invalid": "输入的 manifest 链接无效,或 manifest 不符合规范",
"label": "插件描述文件 Url 地址",
"urlError": "请输入一个有效的网址"
},
"title": {
"desc": "插件标题",
"label": "标题",
"placeholder": "搜索引擎"
}
},
"metaConfig": "插件元信息配置",
"modalDesc": "添加自定义插件后,可用于插件开发验证,也可直接在会话中使用。插件开发文档请参考",
"preview": {
"card": "预览插件展示效果",
"desc": "预览插件描述",
"title": "插件名称预览"
},
"save": "保存",
"saveSuccess": "插件设置保存成功",
"tabs": {
"manifest": "功能描述清单 (Manifest)",
"meta": "插件元信息"
},
"title": "添加自定义插件"
},
"list": {
"item": {
"local.config": "配置",
"local.title": "本地"
}
},
"loading": {
"content": "数据获取中...",
"plugin": "插件运行中..."
},
"pluginList": "插件列表",
"plugins": {
"realtimeWeather": "实时天气预报",
"searchEngine": "搜索引擎",
"undefined": "插件检测中...",
"websiteCrawler": "网页内容提取"
},
"realtimeWeather": {
"data": {
"date": "日期",
"daytemp_float": "日间温度",
"dayweather": "日间天气",
"daywind": "日间风速",
"nighttemp_float": "夜间温度",
"nightweather": "夜间天气",
"nightwind": "夜间风速",
"week": "星期"
},
"title": "近7日天气数据({{city}})",
"updateAt": "更新时间"
},
"responseData": "返回数据"
"unknown": "插件检测中..."
}
}
3 changes: 3 additions & 0 deletions locales/zh_CN/setting.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
}
},
"settingPlugin": {
"add": "添加",
"addTooltip": "添加自定义插件",
"config": "{{id}} 插件配置",
"title": "插件列表"
},
"settingSystem": {
Expand Down
38 changes: 14 additions & 24 deletions src/locales/default/error.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
import { PluginErrorType } from '@lobehub/chat-plugin-sdk';

import { ChatErrorType } from '@/types/fetch';

export default {
pluginSettings: {
desc: '完成以下配置,即可开始使用该插件',
Expand All @@ -19,30 +15,24 @@ export default {
503: '很抱歉,服务器当前无法处理您的请求,可能是由于过载或正在进行维护,请稍后再试',
504: '很抱歉,服务器没有等到上游服务器的回应,请稍后再试',

[PluginErrorType.PluginMarketIndexNotFound]:
'很抱歉,服务器没有找到插件索引,请检查索引地址是否正确',
[PluginErrorType.PluginMarketIndexInvalid]:
'很抱歉,插件索引校验未通过,请检查索引文件格式是否规范',
[PluginErrorType.PluginMetaNotFound]:
'很抱歉,没有在索引中发现该插件,请插件在索引中的配置信息',
[PluginErrorType.PluginMetaInvalid]:
'很抱歉,该插件的元信息校验未通过,请检查插件元信息格式是否规范',
[PluginErrorType.PluginManifestNotFound]:
/* eslint-disable sort-keys-fix/sort-keys-fix */
PluginMarketIndexNotFound: '很抱歉,服务器没有找到插件索引,请检查索引地址是否正确',
PluginMarketIndexInvalid: '很抱歉,插件索引校验未通过,请检查索引文件格式是否规范',
PluginMetaNotFound: '很抱歉,没有在索引中发现该插件,请插件在索引中的配置信息',
PluginMetaInvalid: '很抱歉,该插件的元信息校验未通过,请检查插件元信息格式是否规范',
PluginManifestNotFound:
'很抱歉,服务器没有找到该插件的描述清单 (manifest.json),请检查插件描述文件地址是否正确',
[PluginErrorType.PluginManifestInvalid]:
'很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范',
[PluginErrorType.PluginApiNotFound]:
PluginManifestInvalid: '很抱歉,该插件的描述清单校验未通过,请检查描述清单格式是否规范',
PluginApiNotFound:
'很抱歉,插件描述清单中不存在该 API ,请检查你的请求方法与插件清单 API 是否匹配',
[PluginErrorType.PluginApiParamsError]:
'很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配',
[PluginErrorType.PluginSettingsInvalid]:
'该插件需要正确配置后才可以使用,请检查你的配置是否正确',
[PluginErrorType.PluginServerError]:
PluginApiParamsError: '很抱歉,该插件请求的入参校验未通过,请检查入参与 Api 描述信息是否匹配',
PluginSettingsInvalid: '该插件需要正确配置后才可以使用,请检查你的配置是否正确',
PluginServerError:
'插件服务端请求返回出错,请检查根据下面的报错信息检查你的插件描述文件、插件配置或服务端实现',

[ChatErrorType.InvalidAccessCode]:
'密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key',
[ChatErrorType.OpenAIBizError]: '请求 OpenAI 服务出错,请根据以下信息排查或重试',
InvalidAccessCode: '密码不正确或为空,请输入正确的访问密码,或者添加自定义 OpenAI API Key',
OpenAIBizError: '请求 OpenAI 服务出错,请根据以下信息排查或重试',
/* eslint-enable */
},
unlock: {
apikey: {
Expand Down
Loading

0 comments on commit 3bf1509

Please sign in to comment.