mirror of https://github.com/langgenius/dify.git
chore: hotkey tip i18n
This commit is contained in:
parent
19e152fd0c
commit
7920b89714
|
|
@ -5,7 +5,7 @@ import React, { useEffect, useState } from 'react'
|
|||
import useAvailableVarList from '../../_base/hooks/use-available-var-list'
|
||||
import { BlockEnum } from '../../../types'
|
||||
import { useWorkflowVariableType } from '../../../hooks'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import type { FormInputItem } from '../types'
|
||||
import AddInputField from './add-input-field'
|
||||
import { INSERT_HITL_INPUT_BLOCK_COMMAND } from '@/app/components/base/prompt-editor/plugins/hitl-input-block'
|
||||
|
|
@ -26,6 +26,14 @@ type Props = {
|
|||
editorKey: number
|
||||
}
|
||||
|
||||
const Key: FC<{ children: React.ReactNode, className?: string }> = ({ children, className }) => {
|
||||
return <span className={cn('system-kbd mx-0.5 inline-flex size-4 items-center justify-center rounded-[4px] bg-components-kbd-bg-gray text-text-placeholder ', className)}>{children}</span>
|
||||
}
|
||||
|
||||
const CtrlKey: FC = () => {
|
||||
return <Key className={cn('mr-0', !isMac() && 'w-7')}>{isMac() ? '⌘' : 'Ctrl'}</Key>
|
||||
}
|
||||
|
||||
const FormContent: FC<Props> = ({
|
||||
nodeId,
|
||||
nodeTitle,
|
||||
|
|
@ -132,7 +140,19 @@ const FormContent: FC<Props> = ({
|
|||
),
|
||||
}]}
|
||||
/>
|
||||
<div className='system-xs-regular flex h-8 items-center text-components-input-text-placeholder'>Press / to insert variable, {isMac() ? '⌘' : 'Ctrl'} / to insert input field</div>
|
||||
{isFocus && (
|
||||
<div className='system-xs-regular flex h-8 items-center text-components-input-text-placeholder'>
|
||||
<Trans
|
||||
i18nKey='workflow.nodes.humanInput.formContent.hotkeyTip'
|
||||
components={
|
||||
{
|
||||
Key: <Key>/</Key>,
|
||||
CtrlKey: <CtrlKey />,
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -964,6 +964,7 @@ const translation = {
|
|||
formContent: {
|
||||
title: 'Form Content',
|
||||
tooltip: 'What users will see after opening the form. Supports Markdown formatting.',
|
||||
hotkeyTip: 'Press <Key/> to insert variable, <CtrlKey/><Key/> to insert input field',
|
||||
},
|
||||
userActions: {
|
||||
title: 'User Actions',
|
||||
|
|
|
|||
|
|
@ -964,6 +964,7 @@ const translation = {
|
|||
formContent: {
|
||||
title: '表单内容',
|
||||
tooltip: '用户打开表单后看到的内容。支持 Markdown 格式。',
|
||||
hotkeyTip: '按 <Key/> 插入变量,按 <CtrlKey/><Key/> 插入输入字段',
|
||||
},
|
||||
userActions: {
|
||||
title: '用户操作',
|
||||
|
|
|
|||
Loading…
Reference in New Issue