refactor(i18n): use JSON with flattened key and namespace (#30114)

Co-authored-by: yyh <yuanyouhuilyz@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Stephen Zhou
2025-12-29 14:52:32 +08:00
committed by GitHub
parent 09be869f58
commit 6d0e36479b
2552 changed files with 111159 additions and 142972 deletions

View File

@ -136,7 +136,7 @@ const Card = ({
/>
</div>
<div className="system-xs-medium flex h-4 items-center pl-3 text-text-tertiary">
{t('plugin.auth.connectedWorkspace')}
{t('auth.connectedWorkspace', { ns: 'plugin' })}
<div className="ml-3 h-[1px] grow bg-divider-subtle"></div>
</div>
{
@ -158,7 +158,7 @@ const Card = ({
!credentials_list.length && (
<div className="p-3 pt-1">
<div className="system-xs-regular flex h-10 items-center justify-center rounded-[10px] bg-background-section text-text-tertiary">
{t('plugin.auth.emptyAuth')}
{t('auth.emptyAuth', { ns: 'plugin' })}
</div>
</div>
)
@ -167,7 +167,7 @@ const Card = ({
deleteCredentialId && (
<Confirm
isShow
title={t('datasetDocuments.list.delete.title')}
title={t('list.delete.title', { ns: 'datasetDocuments' })}
isDisabled={doingAction}
onCancel={closeConfirm}
onConfirm={handleConfirm}

View File

@ -44,7 +44,7 @@ const Configure = ({
const canOAuth = oAuthData.client_schema?.length
const oAuthButtonProps: AddOAuthButtonProps = useMemo(() => {
return {
buttonText: t('plugin.auth.addOAuth'),
buttonText: t('auth.addOAuth', { ns: 'plugin' }),
pluginPayload,
}
}, [pluginPayload, t])
@ -52,7 +52,7 @@ const Configure = ({
const apiKeyButtonProps: AddApiKeyButtonProps = useMemo(() => {
return {
pluginPayload,
buttonText: t('plugin.auth.addApi'),
buttonText: t('auth.addApi', { ns: 'plugin' }),
}
}, [pluginPayload, t])
@ -81,7 +81,7 @@ const Configure = ({
variant="secondary-accent"
>
<RiAddLine className="h-4 w-4" />
{t('common.dataSource.configure')}
{t('dataSource.configure', { ns: 'common' })}
</Button>
</PortalToFollowElemTrigger>
<PortalToFollowElemContent className="z-[61]">

View File

@ -52,12 +52,12 @@ const InstallFromMarketplace = ({
<div className="flex items-center justify-between">
<div className="system-md-semibold flex cursor-pointer items-center gap-1 text-text-primary" onClick={() => setCollapse(!collapse)}>
<RiArrowDownSLine className={cn('h-4 w-4', collapse && '-rotate-90')} />
{t('common.modelProvider.installDataSourceProvider')}
{t('modelProvider.installDataSourceProvider', { ns: 'common' })}
</div>
<div className="mb-2 flex items-center pt-2">
<span className="system-sm-regular pr-1 text-text-tertiary">{t('common.modelProvider.discoverMore')}</span>
<span className="system-sm-regular pr-1 text-text-tertiary">{t('modelProvider.discoverMore', { ns: 'common' })}</span>
<Link target="_blank" href={getMarketplaceUrl('', { theme })} className="system-sm-medium inline-flex items-center text-text-accent">
{t('plugin.marketplace.difyMarketplace')}
{t('marketplace.difyMarketplace', { ns: 'plugin' })}
<RiArrowRightUpLine className="h-4 w-4" />
</Link>
</div>

View File

@ -34,7 +34,7 @@ const Item = ({
className="h-6"
value={renameValue}
onChange={e => setRenameValue(e.target.value)}
placeholder={t('common.placeholder.input')}
placeholder={t('placeholder.input', { ns: 'common' })}
onClick={e => e.stopPropagation()}
/>
<Button
@ -53,7 +53,7 @@ const Item = ({
setRenaming(false)
}}
>
{t('common.operation.save')}
{t('operation.save', { ns: 'common' })}
</Button>
<Button
size="small"
@ -62,7 +62,7 @@ const Item = ({
setRenaming(false)
}}
>
{t('common.operation.cancel')}
{t('operation.cancel', { ns: 'common' })}
</Button>
</div>
)

View File

@ -39,7 +39,7 @@ const Operator = ({
text: (
<div className="flex items-center">
<RiHome9Line className="mr-2 h-4 w-4 text-text-tertiary" />
<div className="system-sm-semibold text-text-secondary">{t('plugin.auth.setDefault')}</div>
<div className="system-sm-semibold text-text-secondary">{t('auth.setDefault', { ns: 'plugin' })}</div>
</div>
),
},
@ -51,7 +51,7 @@ const Operator = ({
text: (
<div className="flex items-center">
<RiEditLine className="mr-2 h-4 w-4 text-text-tertiary" />
<div className="system-sm-semibold text-text-secondary">{t('common.operation.rename')}</div>
<div className="system-sm-semibold text-text-secondary">{t('operation.rename', { ns: 'common' })}</div>
</div>
),
},
@ -66,7 +66,7 @@ const Operator = ({
text: (
<div className="flex items-center">
<RiEqualizer2Line className="mr-2 h-4 w-4 text-text-tertiary" />
<div className="system-sm-semibold text-text-secondary">{t('common.operation.edit')}</div>
<div className="system-sm-semibold text-text-secondary">{t('operation.edit', { ns: 'common' })}</div>
</div>
),
},
@ -81,7 +81,7 @@ const Operator = ({
text: (
<div className="flex items-center">
<RiStickyNoteAddLine className="mr-2 h-4 w-4 text-text-tertiary" />
<div className="system-sm-semibold mb-1 text-text-secondary">{t('common.dataSource.notion.changeAuthorizedPages')}</div>
<div className="system-sm-semibold mb-1 text-text-secondary">{t('dataSource.notion.changeAuthorizedPages', { ns: 'common' })}</div>
</div>
),
},
@ -99,7 +99,7 @@ const Operator = ({
<div className="flex items-center">
<RiDeleteBinLine className="mr-2 h-4 w-4 text-text-tertiary" />
<div className="system-sm-semibold text-text-secondary">
{t('common.operation.remove')}
{t('operation.remove', { ns: 'common' })}
</div>
</div>
),