mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 19:32:16 +08:00
chore: fix type check for i18n (#30058)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com> Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
This commit is contained in:
@@ -106,7 +106,7 @@ const CloudPlanItem: FC<CloudPlanItemProps> = ({
|
||||
{ICON_MAP[plan]}
|
||||
<div className="flex min-h-[104px] flex-col gap-y-2">
|
||||
<div className="flex items-center gap-x-2.5">
|
||||
<div className="text-[30px] font-medium leading-[1.2] text-text-primary">{t(`${i18nPrefix}.name`)}</div>
|
||||
<div className="text-[30px] font-medium leading-[1.2] text-text-primary">{t(`${i18nPrefix}.name` as any) as string}</div>
|
||||
{
|
||||
isMostPopularPlan && (
|
||||
<div className="flex items-center justify-center bg-saas-dify-blue-static px-1.5 py-1">
|
||||
@@ -117,7 +117,7 @@ const CloudPlanItem: FC<CloudPlanItemProps> = ({
|
||||
)
|
||||
}
|
||||
</div>
|
||||
<div className="system-sm-regular text-text-secondary">{t(`${i18nPrefix}.description`)}</div>
|
||||
<div className="system-sm-regular text-text-secondary">{t(`${i18nPrefix}.description` as any) as string}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* Price */}
|
||||
|
||||
@@ -42,7 +42,7 @@ const Button = ({
|
||||
onClick={handleGetPayUrl}
|
||||
>
|
||||
<div className="flex grow items-center gap-x-2">
|
||||
<span>{t(`${i18nPrefix}.btnText`)}</span>
|
||||
<span>{t(`${i18nPrefix}.btnText` as any) as string}</span>
|
||||
{isPremiumPlan && (
|
||||
<span className="pb-px pt-[7px]">
|
||||
<AwsMarketplace className="h-6" />
|
||||
|
||||
@@ -85,16 +85,16 @@ const SelfHostedPlanItem: FC<SelfHostedPlanItemProps> = ({
|
||||
<div className=" flex flex-col gap-y-6 px-1 pt-10">
|
||||
{STYLE_MAP[plan].icon}
|
||||
<div className="flex min-h-[104px] flex-col gap-y-2">
|
||||
<div className="text-[30px] font-medium leading-[1.2] text-text-primary">{t(`${i18nPrefix}.name`)}</div>
|
||||
<div className="system-md-regular line-clamp-2 text-text-secondary">{t(`${i18nPrefix}.description`)}</div>
|
||||
<div className="text-[30px] font-medium leading-[1.2] text-text-primary">{t(`${i18nPrefix}.name` as any) as string}</div>
|
||||
<div className="system-md-regular line-clamp-2 text-text-secondary">{t(`${i18nPrefix}.description` as any) as string}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/* Price */}
|
||||
<div className="flex items-end gap-x-2 px-1 pb-8 pt-4">
|
||||
<div className="title-4xl-semi-bold shrink-0 text-text-primary">{t(`${i18nPrefix}.price`)}</div>
|
||||
<div className="title-4xl-semi-bold shrink-0 text-text-primary">{t(`${i18nPrefix}.price` as any) as string}</div>
|
||||
{!isFreePlan && (
|
||||
<span className="system-md-regular pb-0.5 text-text-tertiary">
|
||||
{t(`${i18nPrefix}.priceTip`)}
|
||||
{t(`${i18nPrefix}.priceTip` as any) as string}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -12,13 +12,13 @@ const List = ({
|
||||
}: ListProps) => {
|
||||
const { t } = useTranslation()
|
||||
const i18nPrefix = `billing.plans.${plan}`
|
||||
const features = t(`${i18nPrefix}.features`, { returnObjects: true }) as string[]
|
||||
const features = t(`${i18nPrefix}.features` as any, { returnObjects: true }) as unknown as string[]
|
||||
|
||||
return (
|
||||
<div className="flex flex-col gap-y-[10px] p-6">
|
||||
<div className="system-md-semibold text-text-secondary">
|
||||
<Trans
|
||||
i18nKey={t(`${i18nPrefix}.includesTitle`)}
|
||||
i18nKey={t(`${i18nPrefix}.includesTitle` as any) as string}
|
||||
components={{ highlight: <span className="text-text-warning"></span> }}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -31,7 +31,7 @@ const PriorityLabel = ({ className }: PriorityLabelProps) => {
|
||||
return (
|
||||
<Tooltip popupContent={(
|
||||
<div>
|
||||
<div className="mb-1 text-xs font-semibold text-text-primary">{`${t('billing.plansCommon.documentProcessingPriority')}: ${t(`billing.plansCommon.priority.${priority}`)}`}</div>
|
||||
<div className="mb-1 text-xs font-semibold text-text-primary">{`${t('billing.plansCommon.documentProcessingPriority')}: ${t(`billing.plansCommon.priority.${priority}` as any) as string}`}</div>
|
||||
{
|
||||
priority !== DocumentProcessingPriority.topPriority && (
|
||||
<div className="text-xs text-text-secondary">{t('billing.plansCommon.documentProcessingPriorityTip')}</div>
|
||||
@@ -51,7 +51,7 @@ const PriorityLabel = ({ className }: PriorityLabelProps) => {
|
||||
<RiAedFill className="mr-0.5 size-3" />
|
||||
)
|
||||
}
|
||||
<span>{t(`billing.plansCommon.priority.${priority}`)}</span>
|
||||
<span>{t(`billing.plansCommon.priority.${priority}` as any) as string}</span>
|
||||
</div>
|
||||
</Tooltip>
|
||||
)
|
||||
|
||||
@@ -46,8 +46,8 @@ const UpgradeBtn: FC<Props> = ({
|
||||
}
|
||||
}
|
||||
|
||||
const defaultBadgeLabel = t(`billing.upgradeBtn.${isShort ? 'encourageShort' : 'encourage'}`)
|
||||
const label = labelKey ? t(labelKey) : defaultBadgeLabel
|
||||
const defaultBadgeLabel = t(`billing.upgradeBtn.${isShort ? 'encourageShort' : 'encourage'}` as any) as string
|
||||
const label = labelKey ? t(labelKey as any) as string : defaultBadgeLabel
|
||||
|
||||
if (isPlain) {
|
||||
return (
|
||||
@@ -56,7 +56,7 @@ const UpgradeBtn: FC<Props> = ({
|
||||
style={style}
|
||||
onClick={onClick}
|
||||
>
|
||||
{labelKey ? label : t('billing.upgradeBtn.plain')}
|
||||
{labelKey ? label : t('billing.upgradeBtn.plain' as any) as string}
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user