mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-02 03:55:55 +00:00
perf: completion some english translation
This commit is contained in:
@@ -21,7 +21,7 @@ stages:
|
||||
options:
|
||||
- name: local-agent
|
||||
label:
|
||||
en_US: Embedded Agent
|
||||
en_US: Local Agent
|
||||
zh_Hans: 内置 Agent
|
||||
- name: dify-service-api
|
||||
label:
|
||||
@@ -33,7 +33,7 @@ stages:
|
||||
zh_Hans: 阿里云百炼平台 API
|
||||
- name: local-agent
|
||||
label:
|
||||
en_US: Embedded Agent
|
||||
en_US: Local Agent
|
||||
zh_Hans: 内置 Agent
|
||||
description:
|
||||
en_US: Configure the embedded agent of the pipeline
|
||||
|
||||
@@ -4,6 +4,7 @@ import { httpClient } from '@/app/infra/http/HttpClient';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Switch } from '@/components/ui/switch';
|
||||
import { toast } from 'sonner';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export default function PluginCardComponent({
|
||||
cardVO,
|
||||
@@ -12,6 +13,7 @@ export default function PluginCardComponent({
|
||||
cardVO: PluginCardVO;
|
||||
onCardClick: () => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [enabled, setEnabled] = useState(cardVO.enabled);
|
||||
const [switchEnable, setSwitchEnable] = useState(true);
|
||||
|
||||
@@ -24,7 +26,7 @@ export default function PluginCardComponent({
|
||||
setEnabled(!enabled);
|
||||
})
|
||||
.catch((err) => {
|
||||
toast.error('修改失败:' + err.message);
|
||||
toast.error(t('plugins.modifyFailed') + err.message);
|
||||
})
|
||||
.finally(() => {
|
||||
setSwitchEnable(true);
|
||||
@@ -75,7 +77,9 @@ export default function PluginCardComponent({
|
||||
<path d="M24 12L18.3431 17.6569L16.9289 16.2426L21.1716 12L16.9289 7.75736L18.3431 6.34315L24 12ZM2.82843 12L7.07107 16.2426L5.65685 17.6569L0 12L5.65685 6.34315L7.07107 7.75736L2.82843 12ZM9.78845 21H7.66009L14.2116 3H16.3399L9.78845 21Z"></path>
|
||||
</svg>
|
||||
<div className="text-base text-black font-medium">
|
||||
事件 {Object.keys(cardVO.event_handlers).length}
|
||||
{t('plugins.eventCount', {
|
||||
count: Object.keys(cardVO.event_handlers).length,
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -89,7 +93,7 @@ export default function PluginCardComponent({
|
||||
<path d="M5.32943 3.27158C6.56252 2.8332 7.9923 3.10749 8.97927 4.09446C10.1002 5.21537 10.3019 6.90741 9.5843 8.23385L20.293 18.9437L18.8788 20.3579L8.16982 9.64875C6.84325 10.3669 5.15069 10.1654 4.02952 9.04421C3.04227 8.05696 2.7681 6.62665 3.20701 5.39332L5.44373 7.63C6.02952 8.21578 6.97927 8.21578 7.56505 7.63C8.15084 7.04421 8.15084 6.09446 7.56505 5.50868L5.32943 3.27158ZM15.6968 5.15512L18.8788 3.38736L20.293 4.80157L18.5252 7.98355L16.7574 8.3371L14.6361 10.4584L13.2219 9.04421L15.3432 6.92289L15.6968 5.15512ZM8.97927 13.2868L10.3935 14.7011L5.09018 20.0044C4.69966 20.3949 4.06649 20.3949 3.67597 20.0044C3.31334 19.6417 3.28744 19.0699 3.59826 18.6774L3.67597 18.5902L8.97927 13.2868Z"></path>
|
||||
</svg>
|
||||
<div className="text-base text-black font-medium">
|
||||
工具 {cardVO.tools.length}
|
||||
{t('plugins.toolCount', { count: cardVO.tools.length })}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,6 +13,7 @@ import {
|
||||
} from '@/components/ui/dialog';
|
||||
import { toast } from 'sonner';
|
||||
import { i18nObj } from '@/i18n/I18nProvider';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
enum PluginRemoveStatus {
|
||||
WAIT_INPUT = 'WAIT_INPUT',
|
||||
@@ -31,6 +32,7 @@ export default function PluginForm({
|
||||
onFormSubmit: () => void;
|
||||
onFormCancel: () => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
const [pluginInfo, setPluginInfo] = useState<Plugin>();
|
||||
const [pluginConfig, setPluginConfig] = useState<ApiRespPluginConfig>();
|
||||
const [isSaving, setIsLoading] = useState(false);
|
||||
@@ -117,20 +119,23 @@ export default function PluginForm({
|
||||
>
|
||||
<DialogContent>
|
||||
<DialogHeader>
|
||||
<DialogTitle>删除确认</DialogTitle>
|
||||
<DialogTitle>{t('plugins.deleteConfirm')}</DialogTitle>
|
||||
</DialogHeader>
|
||||
<DialogDescription>
|
||||
{pluginRemoveStatus === PluginRemoveStatus.WAIT_INPUT && (
|
||||
<div>
|
||||
你确定要删除插件({pluginAuthor}/{pluginName})吗?
|
||||
{t('plugins.confirmDeletePlugin', {
|
||||
author: pluginAuthor,
|
||||
name: pluginName,
|
||||
})}
|
||||
</div>
|
||||
)}
|
||||
{pluginRemoveStatus === PluginRemoveStatus.REMOVING && (
|
||||
<div>删除中...</div>
|
||||
<div>{t('plugins.deleting')}</div>
|
||||
)}
|
||||
{pluginRemoveStatus === PluginRemoveStatus.ERROR && (
|
||||
<div>
|
||||
删除失败:
|
||||
{t('plugins.deleteError')}
|
||||
<div className="text-red-500">{pluginRemoveError}</div>
|
||||
</div>
|
||||
)}
|
||||
@@ -144,7 +149,7 @@ export default function PluginForm({
|
||||
setPluginRemoveStatus(PluginRemoveStatus.WAIT_INPUT);
|
||||
}}
|
||||
>
|
||||
取消
|
||||
{t('plugins.cancel')}
|
||||
</Button>
|
||||
)}
|
||||
{pluginRemoveStatus === PluginRemoveStatus.WAIT_INPUT && (
|
||||
@@ -154,12 +159,12 @@ export default function PluginForm({
|
||||
deletePlugin();
|
||||
}}
|
||||
>
|
||||
确认删除
|
||||
{t('plugins.confirmDelete')}
|
||||
</Button>
|
||||
)}
|
||||
{pluginRemoveStatus === PluginRemoveStatus.REMOVING && (
|
||||
<Button variant="destructive" disabled>
|
||||
删除中...
|
||||
{t('plugins.deleting')}
|
||||
</Button>
|
||||
)}
|
||||
{pluginRemoveStatus === PluginRemoveStatus.ERROR && (
|
||||
@@ -170,7 +175,7 @@ export default function PluginForm({
|
||||
// setPluginRemoveStatus(PluginRemoveStatus.WAIT_INPUT);
|
||||
}}
|
||||
>
|
||||
关闭
|
||||
{t('plugins.close')}
|
||||
</Button>
|
||||
)}
|
||||
</DialogFooter>
|
||||
@@ -199,7 +204,9 @@ export default function PluginForm({
|
||||
/>
|
||||
)}
|
||||
{pluginInfo.config_schema.length === 0 && (
|
||||
<div className="text-sm text-gray-500">该插件没有配置项。</div>
|
||||
<div className="text-sm text-gray-500">
|
||||
{t('plugins.pluginNoConfig')}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -214,8 +221,8 @@ export default function PluginForm({
|
||||
disabled={pluginRemoveStatus === PluginRemoveStatus.REMOVING}
|
||||
>
|
||||
{pluginRemoveStatus === PluginRemoveStatus.REMOVING
|
||||
? '删除中...'
|
||||
: '删除插件'}
|
||||
? t('plugins.deleting')
|
||||
: t('plugins.deletePlugin')}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
@@ -223,10 +230,10 @@ export default function PluginForm({
|
||||
onClick={() => handleSubmit(pluginConfig.config)}
|
||||
disabled={isSaving}
|
||||
>
|
||||
{isSaving ? '保存中...' : '保存配置'}
|
||||
{isSaving ? t('plugins.saving') : t('plugins.saveConfig')}
|
||||
</Button>
|
||||
<Button type="button" variant="outline" onClick={onFormCancel}>
|
||||
取消
|
||||
{t('plugins.cancel')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { PluginMarketCardVO } from '@/app/home/plugins/plugin-market/plugin-market-card/PluginMarketCardVO';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export default function PluginMarketCardComponent({
|
||||
cardVO,
|
||||
@@ -8,6 +9,8 @@ export default function PluginMarketCardComponent({
|
||||
cardVO: PluginMarketCardVO;
|
||||
installPlugin: (pluginURL: string) => void;
|
||||
}) {
|
||||
const { t } = useTranslation();
|
||||
|
||||
function handleInstallClick(pluginURL: string) {
|
||||
installPlugin(pluginURL);
|
||||
}
|
||||
@@ -51,7 +54,7 @@ export default function PluginMarketCardComponent({
|
||||
<path d="M12.0006 18.26L4.94715 22.2082L6.52248 14.2799L0.587891 8.7918L8.61493 7.84006L12.0006 0.5L15.3862 7.84006L23.4132 8.7918L17.4787 14.2799L19.054 22.2082L12.0006 18.26Z"></path>
|
||||
</svg>
|
||||
<div className="text-base text-[#ffcd27] font-medium">
|
||||
星标 {cardVO.starCount}
|
||||
{t('plugins.starCount', { count: cardVO.starCount })}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -73,7 +76,7 @@ export default function PluginMarketCardComponent({
|
||||
}}
|
||||
className="cursor-pointer"
|
||||
>
|
||||
安装
|
||||
{t('plugins.install')}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -142,6 +142,22 @@ const enUS = {
|
||||
'Plugin order affects the processing order within the same event, please drag the plugin card to sort',
|
||||
pluginSortSuccess: 'Plugin sort successful',
|
||||
pluginSortError: 'Plugin sort failed: ',
|
||||
pluginNoConfig: 'The plugin has no configuration items.',
|
||||
deleting: 'Deleting...',
|
||||
deletePlugin: 'Delete Plugin',
|
||||
cancel: 'Cancel',
|
||||
saveConfig: 'Save Config',
|
||||
saving: 'Saving...',
|
||||
confirmDeletePlugin:
|
||||
'Are you sure you want to delete the plugin ({{author}}/{{name}})?',
|
||||
confirmDelete: 'Confirm Delete',
|
||||
deleteError: 'Delete failed: ',
|
||||
close: 'Close',
|
||||
deleteConfirm: 'Delete Confirmation',
|
||||
modifyFailed: 'Modify failed: ',
|
||||
eventCount: 'Events: {{count}}',
|
||||
toolCount: 'Tools: {{count}}',
|
||||
starCount: 'Stars: {{count}}',
|
||||
},
|
||||
pipelines: {
|
||||
title: 'Pipelines',
|
||||
|
||||
@@ -138,6 +138,20 @@ const zhHans = {
|
||||
'插件顺序会影响同一事件内的处理顺序,请拖动插件卡片排序',
|
||||
pluginSortSuccess: '插件排序成功',
|
||||
pluginSortError: '插件排序失败:',
|
||||
pluginNoConfig: '插件没有配置项。',
|
||||
deleting: '删除中...',
|
||||
deletePlugin: '删除插件',
|
||||
saveConfig: '保存配置',
|
||||
saving: '保存中...',
|
||||
confirmDeletePlugin: '你确定要删除插件({{author}}/{{name}})吗?',
|
||||
confirmDelete: '确认删除',
|
||||
deleteError: '删除失败:',
|
||||
close: '关闭',
|
||||
deleteConfirm: '删除确认',
|
||||
modifyFailed: '修改失败:',
|
||||
eventCount: '事件:{{count}}',
|
||||
toolCount: '工具:{{count}}',
|
||||
starCount: '星标:{{count}}',
|
||||
},
|
||||
pipelines: {
|
||||
title: '流水线',
|
||||
|
||||
Reference in New Issue
Block a user