From c835555a593dfa8442015ff343f08fa54a67859f Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Wed, 14 May 2025 16:44:48 +0800 Subject: [PATCH] chore: change `zh_CN` to `zh_Hans` --- components.yaml | 2 +- pkg/discover/engine.py | 6 +- pkg/platform/adapter.yaml | 2 +- pkg/platform/sources/aiocqhttp.yaml | 16 ++--- pkg/platform/sources/dingtalk.yaml | 14 ++-- pkg/platform/sources/discord.yaml | 8 +-- pkg/platform/sources/gewechat.yaml | 16 ++--- pkg/platform/sources/lark.py | 2 +- pkg/platform/sources/lark.yaml | 22 +++--- pkg/platform/sources/nakuru.yaml | 12 ++-- pkg/platform/sources/officialaccount.yaml | 20 +++--- pkg/platform/sources/qqbotpy.yaml | 10 +-- pkg/platform/sources/qqofficial.yaml | 12 ++-- pkg/platform/sources/slack.yaml | 10 +-- pkg/platform/sources/telegram.yaml | 8 +-- pkg/platform/sources/wecom.yaml | 20 +++--- pkg/platform/sources/wecomcs.yaml | 14 ++-- pkg/plugin/loaders/classic.py | 4 +- pkg/provider/modelmgr/requester.yaml | 2 +- .../modelmgr/requesters/anthropicmsgs.yaml | 6 +- .../modelmgr/requesters/bailianchatcmpl.yaml | 6 +- .../modelmgr/requesters/chatcmpl.yaml | 6 +- .../modelmgr/requesters/deepseekchatcmpl.yaml | 6 +- .../modelmgr/requesters/geminichatcmpl.yaml | 6 +- .../modelmgr/requesters/giteeaichatcmpl.yaml | 6 +- .../modelmgr/requesters/lmstudiochatcmpl.yaml | 6 +- .../requesters/modelscopechatcmpl.yaml | 8 +-- .../modelmgr/requesters/moonshotchatcmpl.yaml | 6 +- .../modelmgr/requesters/ollamachat.yaml | 6 +- .../modelmgr/requesters/ppiochatcmpl.yaml | 8 +-- .../requesters/siliconflowchatcmpl.yaml | 6 +- .../modelmgr/requesters/volcarkchatcmpl.yaml | 6 +- .../modelmgr/requesters/xaichatcmpl.yaml | 6 +- .../modelmgr/requesters/zhipuaichatcmpl.yaml | 6 +- templates/metadata/pipeline/ai.yaml | 70 +++++++++---------- templates/metadata/pipeline/output.yaml | 40 +++++------ templates/metadata/pipeline/safety.yaml | 28 ++++---- templates/metadata/pipeline/trigger.yaml | 48 ++++++------- .../dynamic-form/testDynamicConfigList.ts | 6 +- web/src/app/infra/entities/api/index.ts | 2 +- web/src/app/infra/entities/common.ts | 2 +- web/src/i18n/I18nProvider.tsx | 4 +- 42 files changed, 247 insertions(+), 247 deletions(-) diff --git a/components.yaml b/components.yaml index fc2084c6..b91b8813 100644 --- a/components.yaml +++ b/components.yaml @@ -4,7 +4,7 @@ metadata: name: builtin-components label: en_US: Builtin Components - zh_CN: 内置组件 + zh_Hans: 内置组件 spec: components: ComponentTemplate: diff --git a/pkg/discover/engine.py b/pkg/discover/engine.py index 2224ba48..335862c0 100644 --- a/pkg/discover/engine.py +++ b/pkg/discover/engine.py @@ -15,7 +15,7 @@ class I18nString(pydantic.BaseModel): en_US: str """英文""" - zh_CN: typing.Optional[str] = None + zh_Hans: typing.Optional[str] = None """中文""" ja_JP: typing.Optional[str] = None @@ -26,8 +26,8 @@ class I18nString(pydantic.BaseModel): dic = {} if self.en_US is not None: dic['en_US'] = self.en_US - if self.zh_CN is not None: - dic['zh_CN'] = self.zh_CN + if self.zh_Hans is not None: + dic['zh_Hans'] = self.zh_Hans if self.ja_JP is not None: dic['ja_JP'] = self.ja_JP return dic diff --git a/pkg/platform/adapter.yaml b/pkg/platform/adapter.yaml index 399ae3ae..d32b412d 100644 --- a/pkg/platform/adapter.yaml +++ b/pkg/platform/adapter.yaml @@ -4,7 +4,7 @@ metadata: name: MessagePlatformAdapter label: en_US: Message Platform Adapter - zh_CN: 消息平台适配器模板类 + zh_Hans: 消息平台适配器模板类 spec: type: - python diff --git a/pkg/platform/sources/aiocqhttp.yaml b/pkg/platform/sources/aiocqhttp.yaml index c915e464..a3ced8e2 100644 --- a/pkg/platform/sources/aiocqhttp.yaml +++ b/pkg/platform/sources/aiocqhttp.yaml @@ -4,40 +4,40 @@ metadata: name: aiocqhttp label: en_US: OneBot v11 - zh_CN: OneBot v11 + zh_Hans: OneBot v11 description: en_US: OneBot v11 Adapter - zh_CN: OneBot v11 适配器,请查看文档了解使用方式 + zh_Hans: OneBot v11 适配器,请查看文档了解使用方式 icon: onebot.png spec: config: - name: host label: en_US: Host - zh_CN: 主机 + zh_Hans: 主机 description: en_US: The host that OneBot v11 listens on for reverse WebSocket connections. Unless you know what you're doing, use 0.0.0.0 - zh_CN: OneBot v11 监听的反向 WS 主机,除非你知道自己在做什么,否则请写 0.0.0.0 + zh_Hans: OneBot v11 监听的反向 WS 主机,除非你知道自己在做什么,否则请写 0.0.0.0 type: string required: true default: 0.0.0.0 - name: port label: en_US: Port - zh_CN: 端口 + zh_Hans: 端口 description: en_US: Port - zh_CN: 监听的端口 + zh_Hans: 监听的端口 type: integer required: true default: 2280 - name: access-token label: en_US: Access Token - zh_CN: 访问令牌 + zh_Hans: 访问令牌 description: en_US: Custom connection token for the protocol endpoint. If the protocol endpoint is not set, don't fill it - zh_CN: 自定义的与协议端的连接令牌,若协议端未设置,则不填 + zh_Hans: 自定义的与协议端的连接令牌,若协议端未设置,则不填 type: string required: false default: "" diff --git a/pkg/platform/sources/dingtalk.yaml b/pkg/platform/sources/dingtalk.yaml index e251bf25..fac2d6ff 100644 --- a/pkg/platform/sources/dingtalk.yaml +++ b/pkg/platform/sources/dingtalk.yaml @@ -4,45 +4,45 @@ metadata: name: dingtalk label: en_US: DingTalk - zh_CN: 钉钉 + zh_Hans: 钉钉 description: en_US: DingTalk Adapter - zh_CN: 钉钉适配器,请查看文档了解使用方式 + zh_Hans: 钉钉适配器,请查看文档了解使用方式 icon: dingtalk.svg spec: config: - name: client_id label: en_US: Client ID - zh_CN: 客户端ID + zh_Hans: 客户端ID type: string required: true default: "" - name: client_secret label: en_US: Client Secret - zh_CN: 客户端密钥 + zh_Hans: 客户端密钥 type: string required: true default: "" - name: robot_code label: en_US: Robot Code - zh_CN: 机器人代码 + zh_Hans: 机器人代码 type: string required: true default: "" - name: robot_name label: en_US: Robot Name - zh_CN: 机器人名称 + zh_Hans: 机器人名称 type: string required: true default: "" - name: markdown_card label: en_US: Markdown Card - zh_CN: 是否使用 Markdown 卡片 + zh_Hans: 是否使用 Markdown 卡片 type: boolean required: false default: true diff --git a/pkg/platform/sources/discord.yaml b/pkg/platform/sources/discord.yaml index c5aa24cc..f000c2d9 100644 --- a/pkg/platform/sources/discord.yaml +++ b/pkg/platform/sources/discord.yaml @@ -4,24 +4,24 @@ metadata: name: discord label: en_US: Discord - zh_CN: Discord + zh_Hans: Discord description: en_US: Discord Adapter - zh_CN: Discord 适配器,请查看文档了解使用方式 + zh_Hans: Discord 适配器,请查看文档了解使用方式 icon: discord.svg spec: config: - name: client_id label: en_US: Client ID - zh_CN: 客户端ID + zh_Hans: 客户端ID type: string required: true default: "" - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" diff --git a/pkg/platform/sources/gewechat.yaml b/pkg/platform/sources/gewechat.yaml index d9473bc9..ffd15dcc 100644 --- a/pkg/platform/sources/gewechat.yaml +++ b/pkg/platform/sources/gewechat.yaml @@ -4,52 +4,52 @@ metadata: name: gewechat label: en_US: GeWeChat - zh_CN: GeWeChat(个人微信) + zh_Hans: GeWeChat(个人微信) description: en_US: GeWeChat Adapter - zh_CN: GeWeChat 适配器,请查看文档了解使用方式 + zh_Hans: GeWeChat 适配器,请查看文档了解使用方式 icon: gewechat.png spec: config: - name: gewechat_url label: en_US: GeWeChat URL - zh_CN: GeWeChat URL + zh_Hans: GeWeChat URL type: string required: true default: "" - name: gewechat_file_url label: en_US: GeWeChat file download URL - zh_CN: GeWeChat 文件下载URL + zh_Hans: GeWeChat 文件下载URL type: string required: true default: "" - name: port label: en_US: Port - zh_CN: 端口 + zh_Hans: 端口 type: integer required: true default: 2286 - name: callback_url label: en_US: Callback URL - zh_CN: 回调URL + zh_Hans: 回调URL type: string required: true default: "" - name: app_id label: en_US: App ID - zh_CN: 应用ID + zh_Hans: 应用ID type: string required: true default: "" - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" diff --git a/pkg/platform/sources/lark.py b/pkg/platform/sources/lark.py index 0bf19a23..e844fc53 100644 --- a/pkg/platform/sources/lark.py +++ b/pkg/platform/sources/lark.py @@ -417,7 +417,7 @@ class LarkAdapter(adapter.MessagePlatformAdapter): lark_message = await self.message_converter.yiri2target(message, self.api_client) final_content = { - 'zh_cn': { + 'zh_Hans': { 'title': '', 'content': lark_message, }, diff --git a/pkg/platform/sources/lark.yaml b/pkg/platform/sources/lark.yaml index c9bcbc69..51efb951 100644 --- a/pkg/platform/sources/lark.yaml +++ b/pkg/platform/sources/lark.yaml @@ -4,61 +4,61 @@ metadata: name: lark label: en_US: Lark - zh_CN: 飞书 + zh_Hans: 飞书 description: en_US: Lark Adapter - zh_CN: 飞书适配器,请查看文档了解使用方式 + zh_Hans: 飞书适配器,请查看文档了解使用方式 icon: lark.svg spec: config: - name: app_id label: en_US: App ID - zh_CN: 应用ID + zh_Hans: 应用ID type: string required: true default: "" - name: app_secret label: en_US: App Secret - zh_CN: 应用密钥 + zh_Hans: 应用密钥 type: string required: true default: "" - name: bot_name label: en_US: Bot Name - zh_CN: 机器人名称 + zh_Hans: 机器人名称 type: string required: true default: "" - name: enable-webhook label: en_US: Enable Webhook Mode - zh_CN: 启用Webhook模式 + zh_Hans: 启用Webhook模式 description: en_US: If enabled, the bot will use webhook mode to receive messages. Otherwise, it will use WS long connection mode - zh_CN: 如果启用,机器人将使用 Webhook 模式接收消息。否则,将使用 WS 长连接模式 + zh_Hans: 如果启用,机器人将使用 Webhook 模式接收消息。否则,将使用 WS 长连接模式 type: boolean required: true default: false - name: port label: en_US: Webhook Port - zh_CN: Webhook端口 + zh_Hans: Webhook端口 description: en_US: Only valid when webhook mode is enabled, please fill in the webhook port - zh_CN: 仅在启用 Webhook 模式时有效,请填写 Webhook 端口 + zh_Hans: 仅在启用 Webhook 模式时有效,请填写 Webhook 端口 type: integer required: true default: 2285 - name: encrypt-key label: en_US: Encrypt Key - zh_CN: 加密密钥 + zh_Hans: 加密密钥 description: en_US: Only valid when webhook mode is enabled, please fill in the encrypt key - zh_CN: 仅在启用 Webhook 模式时有效,请填写加密密钥 + zh_Hans: 仅在启用 Webhook 模式时有效,请填写加密密钥 type: string required: true default: "" diff --git a/pkg/platform/sources/nakuru.yaml b/pkg/platform/sources/nakuru.yaml index 4d1bdeff..00d28474 100644 --- a/pkg/platform/sources/nakuru.yaml +++ b/pkg/platform/sources/nakuru.yaml @@ -4,38 +4,38 @@ metadata: name: nakuru label: en_US: Nakuru - zh_CN: Nakuru + zh_Hans: Nakuru description: en_US: Nakuru Adapter - zh_CN: Nakuru 适配器(go-cqhttp),请查看文档了解使用方式 + zh_Hans: Nakuru 适配器(go-cqhttp),请查看文档了解使用方式 icon: nakuru.png spec: config: - name: host label: en_US: Host - zh_CN: 主机 + zh_Hans: 主机 type: string required: true default: "127.0.0.1" - name: http_port label: en_US: HTTP Port - zh_CN: HTTP端口 + zh_Hans: HTTP端口 type: integer required: true default: 5700 - name: ws_port label: en_US: WebSocket Port - zh_CN: WebSocket端口 + zh_Hans: WebSocket端口 type: integer required: true default: 8080 - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" diff --git a/pkg/platform/sources/officialaccount.yaml b/pkg/platform/sources/officialaccount.yaml index 09337bb9..9cc7b003 100644 --- a/pkg/platform/sources/officialaccount.yaml +++ b/pkg/platform/sources/officialaccount.yaml @@ -4,66 +4,66 @@ metadata: name: officialaccount label: en_US: Official Account - zh_CN: 微信公众号 + zh_Hans: 微信公众号 description: en_US: Official Account Adapter - zh_CN: 微信公众号适配器,请查看文档了解使用方式 + zh_Hans: 微信公众号适配器,请查看文档了解使用方式 icon: officialaccount.png spec: config: - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" - name: EncodingAESKey label: en_US: EncodingAESKey - zh_CN: 消息加解密密钥 + zh_Hans: 消息加解密密钥 type: string required: true default: "" - name: AppID label: en_US: App ID - zh_CN: 应用ID + zh_Hans: 应用ID type: string required: true default: "" - name: AppSecret label: en_US: App Secret - zh_CN: 应用密钥 + zh_Hans: 应用密钥 type: string required: true default: "" - name: Mode label: en_US: Mode - zh_CN: 接入模式 + zh_Hans: 接入模式 type: string required: true default: "drop" - name: LoadingMessage label: en_US: Loading Message - zh_CN: 加载消息 + zh_Hans: 加载消息 type: string required: true default: "AI正在思考中,请发送任意内容获取回复。" - name: host label: en_US: Host - zh_CN: 监听主机 + zh_Hans: 监听主机 type: string required: true default: 0.0.0.0 - name: port label: en_US: Port - zh_CN: 监听端口 + zh_Hans: 监听端口 type: integer required: true default: 2287 diff --git a/pkg/platform/sources/qqbotpy.yaml b/pkg/platform/sources/qqbotpy.yaml index 524e7cdc..e977e318 100644 --- a/pkg/platform/sources/qqbotpy.yaml +++ b/pkg/platform/sources/qqbotpy.yaml @@ -4,31 +4,31 @@ metadata: name: qq-botpy label: en_US: QQBotPy - zh_CN: QQBotPy + zh_Hans: QQBotPy description: en_US: QQ Official API (WebSocket) - zh_CN: QQ 官方 API (WebSocket),请查看文档了解使用方式 + zh_Hans: QQ 官方 API (WebSocket),请查看文档了解使用方式 icon: qqbotpy.svg spec: config: - name: appid label: en_US: App ID - zh_CN: 应用ID + zh_Hans: 应用ID type: string required: true default: "" - name: secret label: en_US: Secret - zh_CN: 密钥 + zh_Hans: 密钥 type: string required: true default: "" - name: intents label: en_US: Intents - zh_CN: 权限 + zh_Hans: 权限 type: array required: true default: [] diff --git a/pkg/platform/sources/qqofficial.yaml b/pkg/platform/sources/qqofficial.yaml index 61881e29..e3f39ce1 100644 --- a/pkg/platform/sources/qqofficial.yaml +++ b/pkg/platform/sources/qqofficial.yaml @@ -4,38 +4,38 @@ metadata: name: qqofficial label: en_US: QQ Official API - zh_CN: QQ 官方 API + zh_Hans: QQ 官方 API description: en_US: QQ Official API (Webhook) - zh_CN: QQ 官方 API (Webhook),请查看文档了解使用方式 + zh_Hans: QQ 官方 API (Webhook),请查看文档了解使用方式 icon: qqofficial.svg spec: config: - name: appid label: en_US: App ID - zh_CN: 应用ID + zh_Hans: 应用ID type: string required: true default: "" - name: secret label: en_US: Secret - zh_CN: 密钥 + zh_Hans: 密钥 type: string required: true default: "" - name: port label: en_US: Port - zh_CN: 监听端口 + zh_Hans: 监听端口 type: integer required: true default: 2284 - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" diff --git a/pkg/platform/sources/slack.yaml b/pkg/platform/sources/slack.yaml index 078b37f5..69d96187 100644 --- a/pkg/platform/sources/slack.yaml +++ b/pkg/platform/sources/slack.yaml @@ -4,31 +4,31 @@ metadata: name: slack label: en_US: Slack - zh_CN: Slack + zh_Hans: Slack description: en_US: Slack Adapter - zh_CN: Slack 适配器,请查看文档了解使用方式 + zh_Hans: Slack 适配器,请查看文档了解使用方式 icon: slack.png spec: config: - name: bot_token label: en_US: Bot Token - zh_CN: 机器人令牌 + zh_Hans: 机器人令牌 type: string required: true default: "" - name: signing_secret label: en_US: signing_secret - zh_CN: 密钥 + zh_Hans: 密钥 type: string required: true default: "" - name: port label: en_US: Port - zh_CN: 监听端口 + zh_Hans: 监听端口 type: int required: true default: 2288 diff --git a/pkg/platform/sources/telegram.yaml b/pkg/platform/sources/telegram.yaml index a83c5fa8..43b9284b 100644 --- a/pkg/platform/sources/telegram.yaml +++ b/pkg/platform/sources/telegram.yaml @@ -4,24 +4,24 @@ metadata: name: telegram label: en_US: Telegram - zh_CN: 电报 + zh_Hans: 电报 description: en_US: Telegram Adapter - zh_CN: 电报适配器,请查看文档了解使用方式 + zh_Hans: 电报适配器,请查看文档了解使用方式 icon: telegram.svg spec: config: - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" - name: markdown_card label: en_US: Markdown Card - zh_CN: 是否使用 Markdown 卡片 + zh_Hans: 是否使用 Markdown 卡片 type: boolean required: false default: true diff --git a/pkg/platform/sources/wecom.yaml b/pkg/platform/sources/wecom.yaml index 68f73e8a..f1015518 100644 --- a/pkg/platform/sources/wecom.yaml +++ b/pkg/platform/sources/wecom.yaml @@ -4,62 +4,62 @@ metadata: name: wecom label: en_US: WeCom - zh_CN: 企业微信 + zh_Hans: 企业微信 description: en_US: WeCom Adapter - zh_CN: 企业微信适配器,请查看文档了解使用方式 + zh_Hans: 企业微信适配器,请查看文档了解使用方式 icon: wecom.png spec: config: - name: host label: en_US: Host - zh_CN: 监听主机 + zh_Hans: 监听主机 description: en_US: Webhook host, unless you know what you're doing, please write 0.0.0.0 - zh_CN: Webhook 监听主机,除非你知道自己在做什么,否则请写 0.0.0.0 + zh_Hans: Webhook 监听主机,除非你知道自己在做什么,否则请写 0.0.0.0 type: string required: true default: "0.0.0.0" - name: port label: en_US: Port - zh_CN: 监听端口 + zh_Hans: 监听端口 type: integer required: true default: 2290 - name: corpid label: en_US: Corpid - zh_CN: 企业ID + zh_Hans: 企业ID type: string required: true default: "" - name: secret label: en_US: Secret - zh_CN: 密钥 + zh_Hans: 密钥 type: string required: true default: "" - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" - name: EncodingAESKey label: en_US: EncodingAESKey - zh_CN: 消息加解密密钥 + zh_Hans: 消息加解密密钥 type: string required: true default: "" - name: contacts_secret label: en_US: Contacts Secret - zh_CN: 通讯录密钥 + zh_Hans: 通讯录密钥 type: string required: true default: "" diff --git a/pkg/platform/sources/wecomcs.yaml b/pkg/platform/sources/wecomcs.yaml index c542e188..5b12150b 100644 --- a/pkg/platform/sources/wecomcs.yaml +++ b/pkg/platform/sources/wecomcs.yaml @@ -4,45 +4,45 @@ metadata: name: wecomcs label: en_US: WeComCustomerService - zh_CN: 企业微信客服 + zh_Hans: 企业微信客服 description: en_US: WeComCSAdapter - zh_CN: 企业微信客服适配器 + zh_Hans: 企业微信客服适配器 icon: wecom.png spec: config: - name: port label: en_US: Port - zh_CN: 监听端口 + zh_Hans: 监听端口 type: int required: true default: 2289 - name: corpid label: en_US: Corpid - zh_CN: 企业ID + zh_Hans: 企业ID type: string required: true default: "" - name: secret label: en_US: Secret - zh_CN: 密钥 + zh_Hans: 密钥 type: string required: true default: "" - name: token label: en_US: Token - zh_CN: 令牌 + zh_Hans: 令牌 type: string required: true default: "" - name: EncodingAESKey label: en_US: EncodingAESKey - zh_CN: 消息加解密密钥 + zh_Hans: 消息加解密密钥 type: string required: true default: "" diff --git a/pkg/plugin/loaders/classic.py b/pkg/plugin/loaders/classic.py index 8aa7382b..7bc5631b 100644 --- a/pkg/plugin/loaders/classic.py +++ b/pkg/plugin/loaders/classic.py @@ -39,8 +39,8 @@ class PluginLoader(loader.PluginLoader): self.ap.logger.debug(f'注册插件 {name} {version} by {author}') container = context.RuntimeContainer( plugin_name=name, - plugin_label=discover_engine.I18nString(en_US=name, zh_CN=name), - plugin_description=discover_engine.I18nString(en_US=description, zh_CN=description), + plugin_label=discover_engine.I18nString(en_US=name, zh_Hans=name), + plugin_description=discover_engine.I18nString(en_US=description, zh_Hans=description), plugin_version=version, plugin_author=author, plugin_repository='', diff --git a/pkg/provider/modelmgr/requester.yaml b/pkg/provider/modelmgr/requester.yaml index 93536f9b..2448fbc7 100644 --- a/pkg/provider/modelmgr/requester.yaml +++ b/pkg/provider/modelmgr/requester.yaml @@ -4,7 +4,7 @@ metadata: name: LLMAPIRequester label: en_US: LLM API Requester - zh_CN: LLM API 请求器 + zh_Hans: LLM API 请求器 spec: type: - python diff --git a/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml b/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml index 07aca1fe..c124fed9 100644 --- a/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml +++ b/pkg/provider/modelmgr/requesters/anthropicmsgs.yaml @@ -4,21 +4,21 @@ metadata: name: anthropic-messages label: en_US: Anthropic - zh_CN: Anthropic + zh_Hans: Anthropic icon: anthropic.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.anthropic.com/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml b/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml index f288df53..24beb915 100644 --- a/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/bailianchatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: bailian-chat-completions label: en_US: Aliyun Bailian - zh_CN: 阿里云百炼 + zh_Hans: 阿里云百炼 icon: bailian.png spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://dashscope.aliyuncs.com/compatible-mode/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/chatcmpl.yaml b/pkg/provider/modelmgr/requesters/chatcmpl.yaml index bbf31e9a..908b30ac 100644 --- a/pkg/provider/modelmgr/requesters/chatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/chatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: openai-chat-completions label: en_US: OpenAI - zh_CN: OpenAI + zh_Hans: OpenAI icon: openai.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.openai.com/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml index 48095697..ea2c7eea 100644 --- a/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/deepseekchatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: deepseek-chat-completions label: en_US: DeepSeek - zh_CN: 深度求索 + zh_Hans: 深度求索 icon: deepseek.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.deepseek.com" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/geminichatcmpl.yaml b/pkg/provider/modelmgr/requesters/geminichatcmpl.yaml index db83b8dd..866f207e 100644 --- a/pkg/provider/modelmgr/requesters/geminichatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/geminichatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: gemini-chat-completions label: en_US: Google Gemini - zh_CN: Google Gemini + zh_Hans: Google Gemini icon: gemini.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://generativelanguage.googleapis.com" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml index 22d48501..a18675a1 100644 --- a/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/giteeaichatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: gitee-ai-chat-completions label: en_US: Gitee AI - zh_CN: Gitee AI + zh_Hans: Gitee AI icon: giteeai.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://ai.gitee.com/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml b/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml index a1e02584..893235b2 100644 --- a/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/lmstudiochatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: lmstudio-chat-completions label: en_US: LM Studio - zh_CN: LM Studio + zh_Hans: LM Studio icon: lmstudio.webp spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "http://127.0.0.1:1234/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/modelscopechatcmpl.yaml b/pkg/provider/modelmgr/requesters/modelscopechatcmpl.yaml index d48f6f29..a641a672 100644 --- a/pkg/provider/modelmgr/requesters/modelscopechatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/modelscopechatcmpl.yaml @@ -4,28 +4,28 @@ metadata: name: modelscope-chat-completions label: en_US: ModelScope - zh_CN: 魔搭社区 + zh_Hans: 魔搭社区 icon: modelscope.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api-inference.modelscope.cn/v1" - name: args label: en_US: Args - zh_CN: 附加参数 + zh_Hans: 附加参数 type: object required: true default: {} - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: int required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml index 7e50130e..f3ae73c8 100644 --- a/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/moonshotchatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: moonshot-chat-completions label: en_US: Moonshot - zh_CN: 月之暗面 + zh_Hans: 月之暗面 icon: moonshot.png spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.moonshot.com/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/ollamachat.yaml b/pkg/provider/modelmgr/requesters/ollamachat.yaml index c62cb1ea..01435775 100644 --- a/pkg/provider/modelmgr/requesters/ollamachat.yaml +++ b/pkg/provider/modelmgr/requesters/ollamachat.yaml @@ -4,21 +4,21 @@ metadata: name: ollama-chat label: en_US: Ollama - zh_CN: Ollama + zh_Hans: Ollama icon: ollama.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "http://127.0.0.1:11434" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/ppiochatcmpl.yaml b/pkg/provider/modelmgr/requesters/ppiochatcmpl.yaml index 22879fea..5fade828 100644 --- a/pkg/provider/modelmgr/requesters/ppiochatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/ppiochatcmpl.yaml @@ -4,27 +4,27 @@ metadata: name: ppio-chat-completions label: en_US: ppio - zh_CN: 派欧云 + zh_Hans: 派欧云 spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.ppinfra.com/v3/openai" - name: args label: en_US: Args - zh_CN: 附加参数 + zh_Hans: 附加参数 type: object required: true default: {} - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: int required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml b/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml index c8dfe770..19b3dcc3 100644 --- a/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/siliconflowchatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: siliconflow-chat-completions label: en_US: SiliconFlow - zh_CN: 硅基流动 + zh_Hans: 硅基流动 icon: siliconflow.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.siliconflow.cn/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml b/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml index bc639b86..402f04e7 100644 --- a/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/volcarkchatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: volcark-chat-completions label: en_US: Volc Engine Ark - zh_CN: 火山方舟 + zh_Hans: 火山方舟 icon: volcark.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://ark.cn-beijing.volces.com/api/v3" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml b/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml index 99588dab..29db4eb3 100644 --- a/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/xaichatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: xai-chat-completions label: en_US: xAI - zh_CN: xAI + zh_Hans: xAI icon: xai.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://api.x.ai/v1" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml b/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml index 68bc3fe3..a05184ef 100644 --- a/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml +++ b/pkg/provider/modelmgr/requesters/zhipuaichatcmpl.yaml @@ -4,21 +4,21 @@ metadata: name: zhipuai-chat-completions label: en_US: ZhipuAI - zh_CN: 智谱 AI + zh_Hans: 智谱 AI icon: zhipuai.svg spec: config: - name: base_url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true default: "https://open.bigmodel.cn/api/paas/v4" - name: timeout label: en_US: Timeout - zh_CN: 超时时间 + zh_Hans: 超时时间 type: integer required: true default: 120 diff --git a/templates/metadata/pipeline/ai.yaml b/templates/metadata/pipeline/ai.yaml index a0305cce..4f25a263 100644 --- a/templates/metadata/pipeline/ai.yaml +++ b/templates/metadata/pipeline/ai.yaml @@ -1,20 +1,20 @@ name: ai label: en_US: AI Feature - zh_CN: AI 能力 + zh_Hans: AI 能力 stages: - name: runner label: en_US: Runner - zh_CN: 运行方式 + zh_Hans: 运行方式 description: en_US: Strategy to call AI to process messages - zh_CN: 调用 AI 处理消息的方式 + zh_Hans: 调用 AI 处理消息的方式 config: - name: runner label: en_US: Runner - zh_CN: 运行器 + zh_Hans: 运行器 type: select required: true default: local-agent @@ -22,66 +22,66 @@ stages: - name: local-agent label: en_US: Embedded Agent - zh_CN: 内置 Agent + zh_Hans: 内置 Agent - name: dify-service-api label: en_US: Dify Service API - zh_CN: Dify 服务 API + zh_Hans: Dify 服务 API - name: dashscope-app-api label: en_US: Aliyun Dashscope App API - zh_CN: 阿里云百炼平台 API + zh_Hans: 阿里云百炼平台 API - name: local-agent label: en_US: Embedded Agent - zh_CN: 内置 Agent + zh_Hans: 内置 Agent description: en_US: Configure the embedded agent of the pipeline - zh_CN: 配置内置 Agent + zh_Hans: 配置内置 Agent config: - name: model label: en_US: Model - zh_CN: 模型 + zh_Hans: 模型 type: llm-model-selector required: true - name: max-round label: en_US: Max Round - zh_CN: 最大回合数 + zh_Hans: 最大回合数 description: en_US: The maximum number of previous messages that the agent can remember - zh_CN: 最大前文消息回合数 + zh_Hans: 最大前文消息回合数 type: integer required: true default: 10 - name: prompt label: en_US: Prompt - zh_CN: 提示词 + zh_Hans: 提示词 description: en_US: The prompt of the agent - zh_CN: 除非您了解消息结构,否则请只使用 system 单提示词 + zh_Hans: 除非您了解消息结构,否则请只使用 system 单提示词 type: prompt-editor required: true - name: dify-service-api label: en_US: Dify Service API - zh_CN: Dify 服务 API + zh_Hans: Dify 服务 API description: en_US: Configure the Dify service API of the pipeline - zh_CN: 配置 Dify 服务 API + zh_Hans: 配置 Dify 服务 API config: - name: base-url label: en_US: Base URL - zh_CN: 基础 URL + zh_Hans: 基础 URL type: string required: true - name: app-type label: en_US: App Type - zh_CN: 应用类型 + zh_Hans: 应用类型 type: select required: true default: chat @@ -89,25 +89,25 @@ stages: - name: chat label: en_US: Chat - zh_CN: 聊天(包括Chatflow) + zh_Hans: 聊天(包括Chatflow) - name: agent label: en_US: Agent - zh_CN: Agent + zh_Hans: Agent - name: workflow label: en_US: Workflow - zh_CN: 工作流 + zh_Hans: 工作流 - name: api-key label: en_US: API Key - zh_CN: API 密钥 + zh_Hans: API 密钥 type: string required: true - name: thinking-convert label: en_US: CoT Convert - zh_CN: 思维链转换策略 + zh_Hans: 思维链转换策略 type: select required: true default: plain @@ -115,27 +115,27 @@ stages: - name: plain label: en_US: Convert to ... - zh_CN: 转换成 ... + zh_Hans: 转换成 ... - name: original label: en_US: Original - zh_CN: 原始 + zh_Hans: 原始 - name: remove label: en_US: Remove - zh_CN: 移除 + zh_Hans: 移除 - name: dashscope-app-api label: en_US: Aliyun Dashscope App API - zh_CN: 阿里云百炼平台 API + zh_Hans: 阿里云百炼平台 API description: en_US: Configure the Aliyun Dashscope App API of the pipeline - zh_CN: 配置阿里云百炼平台 API + zh_Hans: 配置阿里云百炼平台 API config: - name: app-type label: en_US: App Type - zh_CN: 应用类型 + zh_Hans: 应用类型 type: select required: true default: agent @@ -143,30 +143,30 @@ stages: - name: agent label: en_US: Agent - zh_CN: Agent + zh_Hans: Agent - name: workflow label: en_US: Workflow - zh_CN: 工作流 + zh_Hans: 工作流 - name: api-key label: en_US: API Key - zh_CN: API 密钥 + zh_Hans: API 密钥 type: string required: true - name: app-id label: en_US: App ID - zh_CN: 应用 ID + zh_Hans: 应用 ID type: string required: true - name: references_quote label: en_US: References Quote - zh_CN: 引用文本 + zh_Hans: 引用文本 description: en_US: The text prompt when the references are included - zh_CN: 包含引用资料时的文本提示 + zh_Hans: 包含引用资料时的文本提示 type: string required: false default: '参考资料来自:' diff --git a/templates/metadata/pipeline/output.yaml b/templates/metadata/pipeline/output.yaml index 8f035cd1..9fe0cd25 100644 --- a/templates/metadata/pipeline/output.yaml +++ b/templates/metadata/pipeline/output.yaml @@ -1,30 +1,30 @@ name: output label: en_US: Output Processing - zh_CN: 输出处理 + zh_Hans: 输出处理 stages: - name: long-text-processing label: en_US: Long Text Processing - zh_CN: 长文本处理 + zh_Hans: 长文本处理 config: - name: threshold label: en_US: Threshold - zh_CN: 阈值 + zh_Hans: 阈值 description: en_US: The threshold of the long text - zh_CN: 超过此长度的文本将被处理 + zh_Hans: 超过此长度的文本将被处理 type: integer required: true default: 1000 - name: strategy label: en_US: Strategy - zh_CN: 策略 + zh_Hans: 策略 description: en_US: The strategy of the long text - zh_CN: 长文本的处理策略 + zh_Hans: 长文本的处理策略 type: select required: true default: forward @@ -32,76 +32,76 @@ stages: - name: forward label: en_US: Forward Message Component - zh_CN: 转换为转发消息组件(部分平台不支持) + zh_Hans: 转换为转发消息组件(部分平台不支持) - name: image label: en_US: Convert to Image - zh_CN: 转换为图片 + zh_Hans: 转换为图片 - name: font-path label: en_US: Font Path - zh_CN: 字体路径 + zh_Hans: 字体路径 description: en_US: The path of the font to be used when converting to image - zh_CN: 选用转换为图片时,所使用的字体路径 + zh_Hans: 选用转换为图片时,所使用的字体路径 type: string required: false default: '' - name: force-delay label: en_US: Force Delay - zh_CN: 强制延迟 + zh_Hans: 强制延迟 description: en_US: Force the output to be delayed for a while - zh_CN: 强制延迟一段时间后再回复给用户 + zh_Hans: 强制延迟一段时间后再回复给用户 config: - name: min label: en_US: Min Seconds - zh_CN: 最小秒数 + zh_Hans: 最小秒数 type: integer required: true default: 0 - name: max label: en_US: Max Seconds - zh_CN: 最大秒数 + zh_Hans: 最大秒数 type: integer required: true default: 0 - name: misc label: en_US: Misc - zh_CN: 杂项 + zh_Hans: 杂项 config: - name: hide-exception label: en_US: Hide Exception - zh_CN: 不输出异常信息给用户 + zh_Hans: 不输出异常信息给用户 type: boolean required: true default: true - name: at-sender label: en_US: At Sender - zh_CN: 在群聊回复中@发送者 + zh_Hans: 在群聊回复中@发送者 type: boolean required: true default: true - name: quote-origin label: en_US: Quote Origin Message - zh_CN: 引用原消息 + zh_Hans: 引用原消息 type: boolean required: true default: false - name: track-function-calls label: en_US: Track Function Calls - zh_CN: 跟踪函数调用 + zh_Hans: 跟踪函数调用 description: en_US: If enabled, the function calls will be tracked and output to the user - zh_CN: 启用后,Agent 每次调用工具时都会输出一个提示给用户 + zh_Hans: 启用后,Agent 每次调用工具时都会输出一个提示给用户 type: boolean required: true default: false diff --git a/templates/metadata/pipeline/safety.yaml b/templates/metadata/pipeline/safety.yaml index 975b34f9..32edf9f0 100644 --- a/templates/metadata/pipeline/safety.yaml +++ b/templates/metadata/pipeline/safety.yaml @@ -1,17 +1,17 @@ name: safety label: en_US: Safety Control - zh_CN: 安全控制 + zh_Hans: 安全控制 stages: - name: content-filter label: en_US: Content Filter - zh_CN: 内容过滤 + zh_Hans: 内容过滤 config: - name: scope label: en_US: Scope - zh_CN: 检查范围 + zh_Hans: 检查范围 type: select required: true default: all @@ -19,48 +19,48 @@ stages: - name: all label: en_US: All - zh_CN: 全部 + zh_Hans: 全部 - name: income-msg label: en_US: Income Message - zh_CN: 传入消息(用户消息) + zh_Hans: 传入消息(用户消息) - name: output-msg label: en_US: Output Message - zh_CN: 传出消息(机器人消息) + zh_Hans: 传出消息(机器人消息) - name: check-sensitive-words label: en_US: Check Sensitive Words - zh_CN: 检查敏感词 + zh_Hans: 检查敏感词 description: en_US: Sensitive words can be configured in data/metadata/sensitive-words.json - zh_CN: 敏感词内容可以在 data/metadata/sensitive-words.json 中配置 + zh_Hans: 敏感词内容可以在 data/metadata/sensitive-words.json 中配置 type: boolean required: true default: false - name: rate-limit label: en_US: Rate Limit - zh_CN: 速率限制 + zh_Hans: 速率限制 config: - name: window-length label: en_US: Window Length - zh_CN: 窗口长度(秒) + zh_Hans: 窗口长度(秒) type: integer required: true default: 60 - name: limitation label: en_US: Limitation - zh_CN: 限制次数 + zh_Hans: 限制次数 type: integer required: true default: 60 - name: strategy label: en_US: Strategy - zh_CN: 策略 + zh_Hans: 策略 type: select required: true default: drop @@ -68,8 +68,8 @@ stages: - name: drop label: en_US: Drop - zh_CN: 丢弃 + zh_Hans: 丢弃 - name: wait label: en_US: Wait - zh_CN: 等待 \ No newline at end of file + zh_Hans: 等待 \ No newline at end of file diff --git a/templates/metadata/pipeline/trigger.yaml b/templates/metadata/pipeline/trigger.yaml index 69e54363..cb60f448 100644 --- a/templates/metadata/pipeline/trigger.yaml +++ b/templates/metadata/pipeline/trigger.yaml @@ -1,68 +1,68 @@ name: trigger label: en_US: Trigger - zh_CN: 触发条件 + zh_Hans: 触发条件 stages: - name: group-respond-rules label: en_US: Group Respond Rule - zh_CN: 群响应规则 + zh_Hans: 群响应规则 description: en_US: The respond rule of the messages in the groups - zh_CN: 群内消息的响应规则 + zh_Hans: 群内消息的响应规则 config: - name: at label: en_US: At - zh_CN: '@' + zh_Hans: '@' description: en_US: Whether to trigger when the message mentions the bot - zh_CN: 是否在消息@机器人时触发 + zh_Hans: 是否在消息@机器人时触发 type: boolean required: true default: false - name: prefix label: en_US: Prefix - zh_CN: 前缀 + zh_Hans: 前缀 description: en_US: Messages with these prefixes will be responded (the prefixes will be removed automatically when sending to AI) - zh_CN: 具有这些前缀的消息将被响应(发送给 AI 时会自动去除对应前缀) + zh_Hans: 具有这些前缀的消息将被响应(发送给 AI 时会自动去除对应前缀) type: array[string] required: true default: [] - name: regexp label: en_US: Regexp - zh_CN: 正则表达式 + zh_Hans: 正则表达式 description: en_US: Messages with these regular expressions will be responded - zh_CN: 符合这些正则表达式的消息将被响应 + zh_Hans: 符合这些正则表达式的消息将被响应 type: array[string] required: true default: [] - name: random label: en_US: Random - zh_CN: 随机 + zh_Hans: 随机 description: en_US: The probability of the random response, range from 0.0 to 1.0 - zh_CN: 随机响应概率,范围为 0.0-1.0,对应 0% 到 100% + zh_Hans: 随机响应概率,范围为 0.0-1.0,对应 0% 到 100% type: float required: false default: 0 - name: access-control label: en_US: Access Control - zh_CN: 访问控制 + zh_Hans: 访问控制 config: - name: mode label: en_US: Mode - zh_CN: 模式 + zh_Hans: 模式 description: en_US: The mode of the access control - zh_CN: 访问控制模式 + zh_Hans: 访问控制模式 type: select required: true default: blacklist @@ -70,50 +70,50 @@ stages: - name: blacklist label: en_US: Blacklist - zh_CN: 黑名单 + zh_Hans: 黑名单 - name: whitelist label: en_US: Whitelist - zh_CN: 白名单 + zh_Hans: 白名单 - name: blacklist label: en_US: Blacklist - zh_CN: 黑名单 + zh_Hans: 黑名单 type: array[string] required: true default: [] - name: whitelist label: en_US: Whitelist - zh_CN: 白名单 + zh_Hans: 白名单 type: array[string] required: true default: [] - name: ignore-rules label: en_US: Ignore Rules - zh_CN: 消息忽略规则 + zh_Hans: 消息忽略规则 description: en_US: Ignore rules that apply to both group and private messages - zh_CN: 对群聊、私聊消息均适用的忽略规则(优先级高于群响应规则) + zh_Hans: 对群聊、私聊消息均适用的忽略规则(优先级高于群响应规则) config: - name: prefix label: en_US: Prefix - zh_CN: 前缀 + zh_Hans: 前缀 description: en_US: Messages with these prefixes will be ignored - zh_CN: 包含这些前缀的消息将被忽略 + zh_Hans: 包含这些前缀的消息将被忽略 type: array[string] required: true default: [] - name: regexp label: en_US: Regexp - zh_CN: 正则表达式 + zh_Hans: 正则表达式 description: en_US: Messages with these regular expressions will be ignored - zh_CN: 符合这些正则表达式的消息将被忽略 + zh_Hans: 符合这些正则表达式的消息将被忽略 type: array[string] required: true default: [] diff --git a/web/src/app/home/components/dynamic-form/testDynamicConfigList.ts b/web/src/app/home/components/dynamic-form/testDynamicConfigList.ts index ca19b8b2..1e84a2a4 100644 --- a/web/src/app/home/components/dynamic-form/testDynamicConfigList.ts +++ b/web/src/app/home/components/dynamic-form/testDynamicConfigList.ts @@ -9,7 +9,7 @@ export const testDynamicConfigList: IDynamicFormItemSchema[] = [ default: '', id: '111', label: { - zh_CN: '测试字段string', + zh_Hans: '测试字段string', en_US: 'eng test', }, name: 'string_test', @@ -20,7 +20,7 @@ export const testDynamicConfigList: IDynamicFormItemSchema[] = [ default: '', id: '222', label: { - zh_CN: '测试字段int', + zh_Hans: '测试字段int', en_US: 'int eng test', }, name: 'int_test', @@ -31,7 +31,7 @@ export const testDynamicConfigList: IDynamicFormItemSchema[] = [ default: '', id: '333', label: { - zh_CN: '测试字段boolean', + zh_Hans: '测试字段boolean', en_US: 'boolean eng test', }, name: 'boolean_test', diff --git a/web/src/app/infra/entities/api/index.ts b/web/src/app/infra/entities/api/index.ts index 28c9de7f..145f79c0 100644 --- a/web/src/app/infra/entities/api/index.ts +++ b/web/src/app/infra/entities/api/index.ts @@ -9,7 +9,7 @@ export interface ApiResponse { export interface I18nText { en_US: string; - zh_CN: string; + zh_Hans: string; } export interface AsyncTaskCreatedResp { diff --git a/web/src/app/infra/entities/common.ts b/web/src/app/infra/entities/common.ts index 3408c105..02cd99f8 100644 --- a/web/src/app/infra/entities/common.ts +++ b/web/src/app/infra/entities/common.ts @@ -1,5 +1,5 @@ export interface I18nLabel { en_US: string; - zh_CN: string; + zh_Hans: string; ja_JP?: string; } diff --git a/web/src/i18n/I18nProvider.tsx b/web/src/i18n/I18nProvider.tsx index f00836d7..4821d1eb 100644 --- a/web/src/i18n/I18nProvider.tsx +++ b/web/src/i18n/I18nProvider.tsx @@ -13,8 +13,8 @@ export default function I18nProvider({ children }: I18nProviderProps) { } export function i18nObj(i18nText: I18nText): string { const language = localStorage.getItem('langbot_language'); - if ((language === 'zh-Hans' && i18nText.zh_CN) || !i18nText.en_US) { - return i18nText.zh_CN; + if ((language === 'zh-Hans' && i18nText.zh_Hans) || !i18nText.en_US) { + return i18nText.zh_Hans; } return i18nText.en_US; }