mirror of
https://github.com/langgenius/dify.git
synced 2026-05-10 05:56:31 +08:00
Localize human input field configuration labels
This commit is contained in:
parent
703228ffed
commit
cfb501c1f6
@ -130,7 +130,7 @@ const HITLInputComponentUI: FC<HITLInputComponentUIProps> = ({
|
||||
|
||||
const fileTypes = resolvedFormInput.allowed_file_types.join(', ')
|
||||
if (isFileListFormInput(resolvedFormInput))
|
||||
return [fileTypes, resolvedFormInput.max_upload_count ? `${t('feature.fileUpload.numberLimit', { ns: 'appDebug' })}: ${resolvedFormInput.max_upload_count}` : null].filter(Boolean).join(' · ') || inputTypeLabel
|
||||
return [fileTypes, resolvedFormInput.max_upload_count ? `${t(`${i18nPrefix}.maxUploads`, { ns: 'workflow' })}: ${resolvedFormInput.max_upload_count}` : null].filter(Boolean).join(' · ') || inputTypeLabel
|
||||
|
||||
return fileTypes || inputTypeLabel
|
||||
}, [inputTypeLabel, paragraphDefault?.value, resolvedFormInput, t])
|
||||
|
||||
@ -248,7 +248,7 @@ const InputField: React.FC<InputFieldProps> = ({
|
||||
{isSelectFormInput(tempPayload) && (
|
||||
<div className="mt-4">
|
||||
<div className="mb-1.5 system-xs-medium text-text-secondary">
|
||||
{t('variableConfig.options', { ns: 'appDebug' })}
|
||||
{t(`${i18nPrefix}.options`, { ns: 'workflow' })}
|
||||
</div>
|
||||
{tempPayload.option_source.type === 'variable'
|
||||
? (
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import type * as React from 'react'
|
||||
import type { FormInputItem } from '../types'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { isFileFormInput, isFileListFormInput, isSelectFormInput } from '../types'
|
||||
|
||||
const variableRegex = /\{\{#(.+?)#\}\}/g
|
||||
@ -134,6 +135,7 @@ export const Variable: React.FC<{ path: string }> = ({ path }) => {
|
||||
}
|
||||
|
||||
export const Note: React.FC<{ input: FormInputItem, nodeName: (nodeId: string) => string }> = ({ input, nodeName }) => {
|
||||
const { t } = useTranslation()
|
||||
if (isSelectFormInput(input)) {
|
||||
const isVariable = input.option_source.type === 'variable'
|
||||
const path = `{{#${input.option_source.selector.join('.')}#}}`
|
||||
@ -156,7 +158,7 @@ export const Note: React.FC<{ input: FormInputItem, nodeName: (nodeId: string) =
|
||||
if (isFileListFormInput(input)) {
|
||||
const summary = [
|
||||
input.allowed_file_types.join(', '),
|
||||
input.max_upload_count ? `max ${input.max_upload_count}` : null,
|
||||
input.max_upload_count ? `${t('nodes.humanInput.insertInputField.maxUploads', { ns: 'workflow' })}: ${input.max_upload_count}` : null,
|
||||
].filter(Boolean).join(' · ')
|
||||
|
||||
return (
|
||||
|
||||
@ -622,6 +622,8 @@
|
||||
"nodes.humanInput.formContent.tooltip": "What users will see after opening the form. Supports Markdown formatting.",
|
||||
"nodes.humanInput.insertInputField.fieldType": "Field Type",
|
||||
"nodes.humanInput.insertInputField.insert": "Insert",
|
||||
"nodes.humanInput.insertInputField.maxUploads": "Max uploads",
|
||||
"nodes.humanInput.insertInputField.options": "Options",
|
||||
"nodes.humanInput.insertInputField.prePopulateField": "Pre-populate Field",
|
||||
"nodes.humanInput.insertInputField.prePopulateFieldPlaceholder": "Add <staticContent/> or <variable/> users will see this content initially, or leave empty.",
|
||||
"nodes.humanInput.insertInputField.saveResponseAs": "Save Response As",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user