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

@ -53,7 +53,7 @@ const ConfigCredential: FC<Props> = ({
const handleSave = async () => {
for (const field of credentialSchema) {
if (field.required && !tempCredential[field.name]) {
Toast.notify({ type: 'error', message: t('common.errorMsg.fieldRequired', { field: field.label[language] || field.label.en_US }) })
Toast.notify({ type: 'error', message: t('errorMsg.fieldRequired', { ns: 'common', field: field.label[language] || field.label.en_US }) })
return
}
}
@ -71,8 +71,8 @@ const ConfigCredential: FC<Props> = ({
<Drawer
isShow
onHide={onCancel}
title={t('tools.auth.setupModalTitle') as string}
titleDescription={t('tools.auth.setupModalTitleDescription') as string}
title={t('auth.setupModalTitle', { ns: 'tools' }) as string}
titleDescription={t('auth.setupModalTitleDescription', { ns: 'tools' }) as string}
panelClassName="mt-[64px] mb-2 !w-[420px] border-components-panel-border"
maxWidthClassName="!max-w-[420px]"
height="calc(100vh - 64px)"
@ -102,7 +102,7 @@ const ConfigCredential: FC<Props> = ({
rel="noopener noreferrer"
className="inline-flex items-center text-xs text-text-accent"
>
{t('tools.howToGet')}
{t('howToGet', { ns: 'tools' })}
<LinkExternal02 className="ml-1 h-3 w-3" />
</a>
)
@ -111,12 +111,12 @@ const ConfigCredential: FC<Props> = ({
<div className={cn((collection.is_team_authorization && !isHideRemoveBtn) ? 'justify-between' : 'justify-end', 'mt-2 flex ')}>
{
(collection.is_team_authorization && !isHideRemoveBtn) && (
<Button onClick={onRemove}>{t('common.operation.remove')}</Button>
<Button onClick={onRemove}>{t('operation.remove', { ns: 'common' })}</Button>
)
}
<div className="flex space-x-2">
<Button onClick={onCancel}>{t('common.operation.cancel')}</Button>
<Button loading={isLoading || isSaving} disabled={isLoading || isSaving} variant="primary" onClick={handleSave}>{t('common.operation.save')}</Button>
<Button onClick={onCancel}>{t('operation.cancel', { ns: 'common' })}</Button>
<Button loading={isLoading || isSaving} disabled={isLoading || isSaving} variant="primary" onClick={handleSave}>{t('operation.save', { ns: 'common' })}</Button>
</div>
</div>
</>