mirror of
https://github.com/langgenius/dify.git
synced 2026-05-04 17:38:04 +08:00
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:
@ -87,7 +87,7 @@ const AddBlock = ({
|
||||
const renderTriggerElement = useCallback((open: boolean) => {
|
||||
return (
|
||||
<TipPopup
|
||||
title={t('workflow.common.addBlock')}
|
||||
title={t('common.addBlock', { ns: 'workflow' })}
|
||||
>
|
||||
<div className={cn(
|
||||
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg text-text-tertiary hover:bg-state-base-hover hover:text-text-secondary',
|
||||
|
||||
@ -52,7 +52,7 @@ const Control = () => {
|
||||
return (
|
||||
<div className="pointer-events-auto flex flex-col items-center rounded-lg border-[0.5px] border-components-actionbar-border bg-components-actionbar-bg p-0.5 text-text-tertiary shadow-lg">
|
||||
<AddBlock />
|
||||
<TipPopup title={t('workflow.nodes.note.addNote')}>
|
||||
<TipPopup title={t('nodes.note.addNote', { ns: 'workflow' })}>
|
||||
<div
|
||||
className={cn(
|
||||
'ml-[1px] flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
|
||||
@ -64,7 +64,7 @@ const Control = () => {
|
||||
</div>
|
||||
</TipPopup>
|
||||
<Divider className="my-1 w-3.5" />
|
||||
<TipPopup title={t('workflow.common.pointerMode')} shortcuts={['v']}>
|
||||
<TipPopup title={t('common.pointerMode', { ns: 'workflow' })} shortcuts={['v']}>
|
||||
<div
|
||||
className={cn(
|
||||
'mr-[1px] flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg',
|
||||
@ -76,7 +76,7 @@ const Control = () => {
|
||||
<RiCursorLine className="h-4 w-4" />
|
||||
</div>
|
||||
</TipPopup>
|
||||
<TipPopup title={t('workflow.common.handMode')} shortcuts={['h']}>
|
||||
<TipPopup title={t('common.handMode', { ns: 'workflow' })} shortcuts={['h']}>
|
||||
<div
|
||||
className={cn(
|
||||
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg',
|
||||
@ -89,7 +89,7 @@ const Control = () => {
|
||||
</div>
|
||||
</TipPopup>
|
||||
<Divider className="my-1 w-3.5" />
|
||||
<TipPopup title={t('workflow.panel.organizeBlocks')} shortcuts={['ctrl', 'o']}>
|
||||
<TipPopup title={t('panel.organizeBlocks', { ns: 'workflow' })} shortcuts={['ctrl', 'o']}>
|
||||
<div
|
||||
className={cn(
|
||||
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
|
||||
@ -100,7 +100,7 @@ const Control = () => {
|
||||
<RiFunctionAddLine className="h-4 w-4" />
|
||||
</div>
|
||||
</TipPopup>
|
||||
<TipPopup title={maximizeCanvas ? t('workflow.panel.minimize') : t('workflow.panel.maximize')} shortcuts={['f']}>
|
||||
<TipPopup title={maximizeCanvas ? t('panel.minimize', { ns: 'workflow' }) : t('panel.maximize', { ns: 'workflow' })} shortcuts={['f']}>
|
||||
<div
|
||||
className={cn(
|
||||
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
|
||||
|
||||
@ -191,7 +191,7 @@ const MoreActions: FC = () => {
|
||||
}}
|
||||
>
|
||||
<PortalToFollowElemTrigger>
|
||||
<TipPopup title={t('workflow.common.moreActions')}>
|
||||
<TipPopup title={t('common.moreActions', { ns: 'workflow' })}>
|
||||
<div
|
||||
className={cn(
|
||||
'flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-state-base-hover hover:text-text-secondary',
|
||||
@ -208,52 +208,52 @@ const MoreActions: FC = () => {
|
||||
<div className="p-1">
|
||||
<div className="flex items-center gap-2 px-2 py-1 text-xs font-medium text-text-tertiary">
|
||||
<RiExportLine className="h-3 w-3" />
|
||||
{t('workflow.common.exportImage')}
|
||||
{t('common.exportImage', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div className="px-2 py-1 text-xs font-medium text-text-tertiary">
|
||||
{t('workflow.common.currentView')}
|
||||
{t('common.currentView', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div
|
||||
className="system-md-regular flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
|
||||
onClick={() => handleExportImage('png')}
|
||||
>
|
||||
{t('workflow.common.exportPNG')}
|
||||
{t('common.exportPNG', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div
|
||||
className="system-md-regular flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
|
||||
onClick={() => handleExportImage('jpeg')}
|
||||
>
|
||||
{t('workflow.common.exportJPEG')}
|
||||
{t('common.exportJPEG', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div
|
||||
className="system-md-regular flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
|
||||
onClick={() => handleExportImage('svg')}
|
||||
>
|
||||
{t('workflow.common.exportSVG')}
|
||||
{t('common.exportSVG', { ns: 'workflow' })}
|
||||
</div>
|
||||
|
||||
<div className="border-border-divider mx-2 my-1 border-t" />
|
||||
|
||||
<div className="px-2 py-1 text-xs font-medium text-text-tertiary">
|
||||
{t('workflow.common.currentWorkflow')}
|
||||
{t('common.currentWorkflow', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div
|
||||
className="system-md-regular flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
|
||||
onClick={() => handleExportImage('png', true)}
|
||||
>
|
||||
{t('workflow.common.exportPNG')}
|
||||
{t('common.exportPNG', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div
|
||||
className="system-md-regular flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
|
||||
onClick={() => handleExportImage('jpeg', true)}
|
||||
>
|
||||
{t('workflow.common.exportJPEG')}
|
||||
{t('common.exportJPEG', { ns: 'workflow' })}
|
||||
</div>
|
||||
<div
|
||||
className="system-md-regular flex h-8 cursor-pointer items-center rounded-lg px-2 hover:bg-state-base-hover"
|
||||
onClick={() => handleExportImage('svg', true)}
|
||||
>
|
||||
{t('workflow.common.exportSVG')}
|
||||
{t('common.exportSVG', { ns: 'workflow' })}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -82,7 +82,7 @@ const ZoomInOut: FC = () => {
|
||||
[
|
||||
{
|
||||
key: ZoomType.zoomToFit,
|
||||
text: t('workflow.operator.zoomToFit'),
|
||||
text: t('operator.zoomToFit', { ns: 'workflow' }),
|
||||
},
|
||||
],
|
||||
]
|
||||
@ -142,7 +142,7 @@ const ZoomInOut: FC = () => {
|
||||
)}
|
||||
>
|
||||
<TipPopup
|
||||
title={t('workflow.operator.zoomOut')}
|
||||
title={t('operator.zoomOut', { ns: 'workflow' })}
|
||||
shortcuts={['ctrl', '-']}
|
||||
>
|
||||
<div
|
||||
@ -163,7 +163,7 @@ const ZoomInOut: FC = () => {
|
||||
%
|
||||
</div>
|
||||
<TipPopup
|
||||
title={t('workflow.operator.zoomIn')}
|
||||
title={t('operator.zoomIn', { ns: 'workflow' })}
|
||||
shortcuts={['ctrl', '+']}
|
||||
>
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user