mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 02:18:08 +08:00
fix(sandbox-provider): use i18n for provider card descriptions
Use PROVIDER_DESCRIPTION_KEYS mapping to display localized descriptions instead of raw backend data, ensuring descriptions match Figma design.
This commit is contained in:
@ -23,6 +23,13 @@ const PROVIDER_ICONS: Record<string, string> = {
|
|||||||
local: '/sandbox-providers/local.svg',
|
local: '/sandbox-providers/local.svg',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const PROVIDER_DESCRIPTION_KEYS = {
|
||||||
|
e2b: 'sandboxProvider.e2b.description',
|
||||||
|
daytona: 'sandboxProvider.daytona.description',
|
||||||
|
docker: 'sandboxProvider.docker.description',
|
||||||
|
local: 'sandboxProvider.local.description',
|
||||||
|
} as const
|
||||||
|
|
||||||
const ProviderIcon = ({ providerType }: { providerType: string }) => {
|
const ProviderIcon = ({ providerType }: { providerType: string }) => {
|
||||||
const iconSrc = PROVIDER_ICONS[providerType] || PROVIDER_ICONS.e2b
|
const iconSrc = PROVIDER_ICONS[providerType] || PROVIDER_ICONS.e2b
|
||||||
|
|
||||||
@ -72,7 +79,7 @@ const ProviderCard = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="system-xs-regular text-text-tertiary">
|
<div className="system-xs-regular text-text-tertiary">
|
||||||
{provider.description}
|
{t(PROVIDER_DESCRIPTION_KEYS[provider.provider_type as keyof typeof PROVIDER_DESCRIPTION_KEYS] ?? 'sandboxProvider.e2b.description', { ns: 'common' })}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user