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

@ -83,7 +83,7 @@ const LinkEditorComponent = ({
className="mr-0.5 h-6 w-[196px] appearance-none rounded-sm bg-transparent p-1 text-[13px] text-components-input-text-filled outline-none"
value={url}
onChange={e => setUrl(e.target.value)}
placeholder={t('workflow.nodes.note.editor.enterUrl') || ''}
placeholder={t('nodes.note.editor.enterUrl', { ns: 'workflow' }) || ''}
autoFocus
/>
<Button
@ -92,7 +92,7 @@ const LinkEditorComponent = ({
disabled={!url}
onClick={() => handleSaveLink(url)}
>
{t('common.operation.ok')}
{t('operation.ok', { ns: 'common' })}
</Button>
</>
)
@ -108,7 +108,7 @@ const LinkEditorComponent = ({
>
<RiExternalLinkLine className="mr-1 h-3 w-3" />
<div className="mr-1">
{t('workflow.nodes.note.editor.openLink')}
{t('nodes.note.editor.openLink', { ns: 'workflow' })}
</div>
<div
title={escape(url)}
@ -126,14 +126,14 @@ const LinkEditorComponent = ({
}}
>
<RiEditLine className="mr-1 h-3 w-3" />
{t('common.operation.edit')}
{t('operation.edit', { ns: 'common' })}
</div>
<div
className="flex h-6 cursor-pointer items-center rounded-md px-2 hover:bg-state-base-hover"
onClick={handleUnlink}
>
<RiLinkUnlinkM className="mr-1 h-3 w-3" />
{t('workflow.nodes.note.editor.unlink')}
{t('nodes.note.editor.unlink', { ns: 'workflow' })}
</div>
</>
)

View File

@ -92,7 +92,7 @@ export const useLink = () => {
const handleSaveLink = useCallback((url: string) => {
if (url && !urlRegExp.test(url)) {
notify({ type: 'error', message: t('workflow.nodes.note.editor.invalidUrl') })
notify({ type: 'error', message: t('nodes.note.editor.invalidUrl', { ns: 'workflow' }) })
return
}
editor.dispatchCommand(TOGGLE_LINK_COMMAND, escape(url))