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

@ -117,7 +117,7 @@ const Authorized = ({
await deletePluginCredential({ credential_id: pendingOperationCredentialId.current })
notify({
type: 'success',
message: t('common.api.actionSuccess'),
message: t('api.actionSuccess', { ns: 'common' }),
})
onUpdate?.()
setDeleteCredentialId(null)
@ -144,7 +144,7 @@ const Authorized = ({
await setPluginDefaultCredential(id)
notify({
type: 'success',
message: t('common.api.actionSuccess'),
message: t('api.actionSuccess', { ns: 'common' }),
})
onUpdate?.()
}
@ -164,7 +164,7 @@ const Authorized = ({
await updatePluginCredential(payload)
notify({
type: 'success',
message: t('common.api.actionSuccess'),
message: t('api.actionSuccess', { ns: 'common' }),
})
onUpdate?.()
}
@ -203,12 +203,12 @@ const Authorized = ({
&nbsp;
{
credentials.length > 1
? t('plugin.auth.authorizations')
: t('plugin.auth.authorization')
? t('auth.authorizations', { ns: 'plugin' })
: t('auth.authorization', { ns: 'plugin' })
}
{
!!unavailableCredentials.length && (
` (${unavailableCredentials.length} ${t('plugin.auth.unavailable')})`
` (${unavailableCredentials.length} ${t('auth.unavailable', { ns: 'plugin' })})`
)
}
<RiArrowDownSLine className="ml-0.5 h-4 w-4" />
@ -332,7 +332,7 @@ const Authorized = ({
deleteCredentialId && (
<Confirm
isShow
title={t('datasetDocuments.list.delete.title')}
title={t('list.delete.title', { ns: 'datasetDocuments' })}
isDisabled={doingAction}
onCancel={closeConfirm}
onConfirm={handleConfirm}

View File

@ -83,7 +83,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
@ -98,7 +98,7 @@ const Item = ({
setRenaming(false)
}}
>
{t('common.operation.save')}
{t('operation.save', { ns: 'common' })}
</Button>
<Button
size="small"
@ -107,7 +107,7 @@ const Item = ({
setRenaming(false)
}}
>
{t('common.operation.cancel')}
{t('operation.cancel', { ns: 'common' })}
</Button>
</div>
)
@ -139,7 +139,7 @@ const Item = ({
{
credential.is_default && (
<Badge className="shrink-0">
{t('plugin.auth.default')}
{t('auth.default', { ns: 'plugin' })}
</Badge>
)
}
@ -166,13 +166,13 @@ const Item = ({
onSetDefault?.(credential.id)
}}
>
{t('plugin.auth.setDefault')}
{t('auth.setDefault', { ns: 'plugin' })}
</Button>
)
}
{
!disableRename && !credential.from_enterprise && !credential.not_allowed_to_use && (
<Tooltip popupContent={t('common.operation.rename')}>
<Tooltip popupContent={t('operation.rename', { ns: 'common' })}>
<ActionButton
disabled={disabled}
onClick={(e) => {
@ -188,7 +188,7 @@ const Item = ({
}
{
!isOAuth && !disableEdit && !credential.from_enterprise && !credential.not_allowed_to_use && (
<Tooltip popupContent={t('common.operation.edit')}>
<Tooltip popupContent={t('operation.edit', { ns: 'common' })}>
<ActionButton
disabled={disabled}
onClick={(e) => {
@ -210,7 +210,7 @@ const Item = ({
}
{
!disableDelete && !credential.from_enterprise && (
<Tooltip popupContent={t('common.operation.delete')}>
<Tooltip popupContent={t('operation.delete', { ns: 'common' })}>
<ActionButton
className="hover:bg-transparent"
disabled={disabled}
@ -232,7 +232,7 @@ const Item = ({
if (credential.not_allowed_to_use) {
return (
<Tooltip popupContent={t('plugin.auth.customCredentialUnavailable')}>
<Tooltip popupContent={t('auth.customCredentialUnavailable', { ns: 'plugin' })}>
{CredentialItem}
</Tooltip>
)