mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-10 03:16:51 +08:00
fix: i18n typo (#8077)
This commit is contained in:
@@ -47,7 +47,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
||||
if (!isValid) {
|
||||
Toast.notify({
|
||||
type: 'error',
|
||||
message: t(`appDebug.varKeyError.${errorMessageKey}`, { key: t('appDebug.variableConig.varName') }),
|
||||
message: t(`appDebug.varKeyError.${errorMessageKey}`, { key: t('appDebug.variableConfig.varName') }),
|
||||
})
|
||||
return false
|
||||
}
|
||||
@@ -101,7 +101,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
||||
// }
|
||||
|
||||
if (!tempPayload.label) {
|
||||
Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.labelNameRequired') })
|
||||
Toast.notify({ type: 'error', message: t('appDebug.variableConfig.errorMsg.labelNameRequired') })
|
||||
return
|
||||
}
|
||||
if (isStringInput || type === InputVarType.number) {
|
||||
@@ -109,7 +109,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
||||
}
|
||||
else {
|
||||
if (options?.length === 0) {
|
||||
Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.atLeastOneOption') })
|
||||
Toast.notify({ type: 'error', message: t('appDebug.variableConfig.errorMsg.atLeastOneOption') })
|
||||
return
|
||||
}
|
||||
const obj: Record<string, boolean> = {}
|
||||
@@ -122,7 +122,7 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
||||
obj[o] = true
|
||||
})
|
||||
if (hasRepeatedItem) {
|
||||
Toast.notify({ type: 'error', message: t('appDebug.variableConig.errorMsg.optionRepeat') })
|
||||
Toast.notify({ type: 'error', message: t('appDebug.variableConfig.errorMsg.optionRepeat') })
|
||||
return
|
||||
}
|
||||
onConfirm(tempPayload, moreInfo)
|
||||
@@ -131,14 +131,14 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={t(`appDebug.variableConig.${isCreate ? 'addModalTitle' : 'editModalTitle'}`)}
|
||||
title={t(`appDebug.variableConfig.${isCreate ? 'addModalTitle' : 'editModalTitle'}`)}
|
||||
isShow={isShow}
|
||||
onClose={onClose}
|
||||
>
|
||||
<div className='mb-8'>
|
||||
<div className='space-y-2'>
|
||||
|
||||
<Field title={t('appDebug.variableConig.fieldType')}>
|
||||
<Field title={t('appDebug.variableConfig.fieldType')}>
|
||||
<div className='flex space-x-2'>
|
||||
<SelectTypeItem type={InputVarType.textInput} selected={type === InputVarType.textInput} onClick={() => handlePayloadChange('type')(InputVarType.textInput)} />
|
||||
<SelectTypeItem type={InputVarType.paragraph} selected={type === InputVarType.paragraph} onClick={() => handlePayloadChange('type')(InputVarType.paragraph)} />
|
||||
@@ -147,39 +147,39 @@ const ConfigModal: FC<IConfigModalProps> = ({
|
||||
</div>
|
||||
</Field>
|
||||
|
||||
<Field title={t('appDebug.variableConig.varName')}>
|
||||
<Field title={t('appDebug.variableConfig.varName')}>
|
||||
<input
|
||||
type='text'
|
||||
className={inputClassName}
|
||||
value={variable}
|
||||
onChange={e => handlePayloadChange('variable')(e.target.value)}
|
||||
onBlur={handleVarKeyBlur}
|
||||
placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
||||
placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
||||
/>
|
||||
</Field>
|
||||
<Field title={t('appDebug.variableConig.labelName')}>
|
||||
<Field title={t('appDebug.variableConfig.labelName')}>
|
||||
<input
|
||||
type='text'
|
||||
className={inputClassName}
|
||||
value={label as string}
|
||||
onChange={e => handlePayloadChange('label')(e.target.value)}
|
||||
placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
||||
placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
||||
/>
|
||||
</Field>
|
||||
|
||||
{isStringInput && (
|
||||
<Field title={t('appDebug.variableConig.maxLength')}>
|
||||
<Field title={t('appDebug.variableConfig.maxLength')}>
|
||||
<ConfigString maxLength={type === InputVarType.textInput ? TEXT_MAX_LENGTH : Infinity} modelId={modelConfig.model_id} value={max_length} onChange={handlePayloadChange('max_length')} />
|
||||
</Field>
|
||||
|
||||
)}
|
||||
{type === InputVarType.select && (
|
||||
<Field title={t('appDebug.variableConig.options')}>
|
||||
<Field title={t('appDebug.variableConfig.options')}>
|
||||
<ConfigSelect options={options || []} onChange={handlePayloadChange('options')} />
|
||||
</Field>
|
||||
)}
|
||||
|
||||
<Field title={t('appDebug.variableConig.required')}>
|
||||
<Field title={t('appDebug.variableConfig.required')}>
|
||||
<Switch defaultValue={tempPayload.required} onChange={handlePayloadChange('required')} />
|
||||
</Field>
|
||||
</div>
|
||||
|
||||
@@ -77,7 +77,7 @@ const ConfigSelect: FC<IConfigSelectProps> = ({
|
||||
onClick={() => { onChange([...options, '']) }}
|
||||
className='flex items-center h-9 px-3 gap-2 rounded-lg cursor-pointer text-gray-400 bg-gray-100'>
|
||||
<PlusIcon width={16} height={16}></PlusIcon>
|
||||
<div className='text-gray-500 text-[13px]'>{t('appDebug.variableConig.addOption')}</div>
|
||||
<div className='text-gray-500 text-[13px]'>{t('appDebug.variableConfig.addOption')}</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -18,7 +18,7 @@ const SelectTypeItem: FC<ISelectTypeItemProps> = ({
|
||||
onClick,
|
||||
}) => {
|
||||
const { t } = useTranslation()
|
||||
const typeName = t(`appDebug.variableConig.${type}`)
|
||||
const typeName = t(`appDebug.variableConfig.${type}`)
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
@@ -62,14 +62,14 @@ const SelectVarType: FC<Props> = ({
|
||||
<PortalToFollowElemContent style={{ zIndex: 1000 }}>
|
||||
<div className='bg-white border border-gray-200 shadow-lg rounded-lg min-w-[192px]'>
|
||||
<div className='p-1'>
|
||||
<SelectItem type={InputVarType.textInput} value='string' text={t('appDebug.variableConig.string')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.paragraph} value='paragraph' text={t('appDebug.variableConig.paragraph')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.select} value='select' text={t('appDebug.variableConig.select')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.number} value='number' text={t('appDebug.variableConig.number')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.textInput} value='string' text={t('appDebug.variableConfig.string')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.paragraph} value='paragraph' text={t('appDebug.variableConfig.paragraph')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.select} value='select' text={t('appDebug.variableConfig.select')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem type={InputVarType.number} value='number' text={t('appDebug.variableConfig.number')} onClick={handleChange}></SelectItem>
|
||||
</div>
|
||||
<div className='h-[1px] bg-gray-100'></div>
|
||||
<div className='p-1'>
|
||||
<SelectItem Icon={ApiConnection} value='api' text={t('appDebug.variableConig.apiBasedVar')} onClick={handleChange}></SelectItem>
|
||||
<SelectItem Icon={ApiConnection} value='api' text={t('appDebug.variableConfig.apiBasedVar')} onClick={handleChange}></SelectItem>
|
||||
</div>
|
||||
</div>
|
||||
</PortalToFollowElemContent>
|
||||
|
||||
@@ -227,7 +227,7 @@ const OpeningStatement: FC<IOpeningStatementProps> = ({
|
||||
onClick={() => { setTempSuggestedQuestions([...tempSuggestedQuestions, '']) }}
|
||||
className='mt-1 flex items-center h-9 px-3 gap-2 rounded-lg cursor-pointer text-gray-400 bg-gray-100 hover:bg-gray-200'>
|
||||
<RiAddLine className='w-4 h-4' />
|
||||
<div className='text-gray-500 text-[13px]'>{t('appDebug.variableConig.addOption')}</div>
|
||||
<div className='text-gray-500 text-[13px]'>{t('appDebug.variableConfig.addOption')}</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -189,7 +189,7 @@ const ExternalDataToolModal: FC<ExternalDataToolModalProps> = ({
|
||||
className='!p-8 !pb-6 !max-w-none !w-[640px]'
|
||||
>
|
||||
<div className='mb-2 text-xl font-semibold text-gray-900'>
|
||||
{`${action} ${t('appDebug.variableConig.apiBasedVar')}`}
|
||||
{`${action} ${t('appDebug.variableConfig.apiBasedVar')}`}
|
||||
</div>
|
||||
<div className='py-2'>
|
||||
<div className='leading-9 text-sm font-medium text-gray-900'>
|
||||
|
||||
@@ -22,7 +22,7 @@ const AppUnavailable: FC<IAppUnavailableProps> = ({
|
||||
style={{
|
||||
borderRight: '1px solid rgba(0,0,0,.3)',
|
||||
}}>{code}</h1>
|
||||
<div className='text-sm'>{unknownReason || (isUnknownReason ? t('share.common.appUnkonwError') : t('share.common.appUnavailable'))}</div>
|
||||
<div className='text-sm'>{unknownReason || (isUnknownReason ? t('share.common.appUnknownError') : t('share.common.appUnavailable'))}</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ const ConfigPanel = () => {
|
||||
: (
|
||||
<div className={`flex items-center justify-end ${isMobile && 'w-full'}`}>
|
||||
<div className='flex items-center pr-3 space-x-3'>
|
||||
<span className='uppercase'>{t('share.chat.powerBy')}</span>
|
||||
<span className='uppercase'>{t('share.chat.poweredBy')}</span>
|
||||
{
|
||||
customConfig?.replace_webapp_logo
|
||||
? <img src={customConfig?.replace_webapp_logo} alt='logo' className='block w-auto h-5' />
|
||||
|
||||
@@ -160,7 +160,7 @@ const ConfigPanel = () => {
|
||||
: (
|
||||
<div className={cn('flex items-center justify-end', isMobile && 'w-full')}>
|
||||
<div className='flex items-center pr-3 space-x-3'>
|
||||
<span className='uppercase'>{t('share.chat.powerBy')}</span>
|
||||
<span className='uppercase'>{t('share.chat.poweredBy')}</span>
|
||||
{
|
||||
customConfig?.replace_webapp_logo
|
||||
? <img src={customConfig?.replace_webapp_logo} alt='logo' className='block w-auto h-5' />
|
||||
|
||||
@@ -248,7 +248,7 @@ const OpeningStatement: FC<OpeningStatementProps> = ({
|
||||
onClick={() => { setTempSuggestedQuestions([...tempSuggestedQuestions, '']) }}
|
||||
className='mt-1 flex items-center h-9 px-3 gap-2 rounded-lg cursor-pointer text-gray-400 bg-gray-100 hover:bg-gray-200'>
|
||||
<RiAddLine className='w-4 h-4' />
|
||||
<div className='text-gray-500 text-[13px]'>{t('appDebug.variableConig.addOption')}</div>
|
||||
<div className='text-gray-500 text-[13px]'>{t('appDebug.variableConfig.addOption')}</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -743,7 +743,7 @@ const StepTwo = ({
|
||||
</div>
|
||||
{hasSetIndexType && indexType === IndexingType.ECONOMICAL && (
|
||||
<div className='mt-2 text-xs text-gray-500 font-medium'>
|
||||
{t('datasetCreation.stepTwo.indexSettedTip')}
|
||||
{t('datasetCreation.stepTwo.indexSettingTip')}
|
||||
<Link className='text-[#155EEF]' href={`/datasets/${datasetId}/settings`}>{t('datasetCreation.stepTwo.datasetSettingLink')}</Link>
|
||||
</div>
|
||||
)}
|
||||
@@ -790,7 +790,7 @@ const StepTwo = ({
|
||||
/>
|
||||
{!!datasetId && (
|
||||
<div className='mt-2 text-xs text-gray-500 font-medium'>
|
||||
{t('datasetCreation.stepTwo.indexSettedTip')}
|
||||
{t('datasetCreation.stepTwo.indexSettingTip')}
|
||||
<Link className='text-[#155EEF]' href={`/datasets/${datasetId}/settings`}>{t('datasetCreation.stepTwo.datasetSettingLink')}</Link>
|
||||
</div>
|
||||
)}
|
||||
@@ -890,7 +890,7 @@ const StepTwo = ({
|
||||
</div>
|
||||
<div className={s.divider} />
|
||||
<div className={s.segmentCount}>
|
||||
<div className='mb-2 text-xs font-medium text-gray-500'>{t('datasetCreation.stepTwo.emstimateSegment')}</div>
|
||||
<div className='mb-2 text-xs font-medium text-gray-500'>{t('datasetCreation.stepTwo.estimateSegment')}</div>
|
||||
<div className='flex items-center text-sm leading-6 font-medium text-gray-800'>
|
||||
{
|
||||
fileIndexingEstimate
|
||||
|
||||
@@ -11,8 +11,8 @@ import { IS_CE_EDITION } from '@/config'
|
||||
import type { InvitationResult } from '@/models/common'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
|
||||
export type SuccessInvationResult = Extract<InvitationResult, { status: 'success' }>
|
||||
export type FailedInvationResult = Extract<InvitationResult, { status: 'failed' }>
|
||||
export type SuccessInvitationResult = Extract<InvitationResult, { status: 'success' }>
|
||||
export type FailedInvitationResult = Extract<InvitationResult, { status: 'failed' }>
|
||||
|
||||
type IInvitedModalProps = {
|
||||
invitationResults: InvitationResult[]
|
||||
@@ -24,8 +24,8 @@ const InvitedModal = ({
|
||||
}: IInvitedModalProps) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
const successInvationResults = useMemo<SuccessInvationResult[]>(() => invitationResults?.filter(item => item.status === 'success') as SuccessInvationResult[], [invitationResults])
|
||||
const failedInvationResults = useMemo<FailedInvationResult[]>(() => invitationResults?.filter(item => item.status !== 'success') as FailedInvationResult[], [invitationResults])
|
||||
const successInvitationResults = useMemo<SuccessInvitationResult[]>(() => invitationResults?.filter(item => item.status === 'success') as SuccessInvitationResult[], [invitationResults])
|
||||
const failedInvitationResults = useMemo<FailedInvitationResult[]>(() => invitationResults?.filter(item => item.status !== 'success') as FailedInvitationResult[], [invitationResults])
|
||||
|
||||
return (
|
||||
<div className={s.wrap}>
|
||||
@@ -49,20 +49,20 @@ const InvitedModal = ({
|
||||
<div className='mb-5 text-sm text-gray-500'>{t('common.members.invitationSentTip')}</div>
|
||||
<div className='flex flex-col gap-2 mb-9'>
|
||||
{
|
||||
!!successInvationResults.length
|
||||
!!successInvitationResults.length
|
||||
&& <>
|
||||
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.invitationLink')}</div>
|
||||
{successInvationResults.map(item =>
|
||||
{successInvitationResults.map(item =>
|
||||
<InvitationLink key={item.email} value={item} />)}
|
||||
</>
|
||||
}
|
||||
{
|
||||
!!failedInvationResults.length
|
||||
!!failedInvitationResults.length
|
||||
&& <>
|
||||
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.failedinvitationEmails')}</div>
|
||||
<div className='py-2 text-sm font-Medium text-gray-900'>{t('common.members.failedInvitationEmails')}</div>
|
||||
<div className='flex flex-wrap justify-between gap-y-1'>
|
||||
{
|
||||
failedInvationResults.map(item =>
|
||||
failedInvitationResults.map(item =>
|
||||
<div key={item.email} className='flex justify-center border border-red-300 rounded-md px-1 bg-orange-50'>
|
||||
<Tooltip
|
||||
popupContent={item.message}
|
||||
|
||||
@@ -3,12 +3,12 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
|
||||
import { t } from 'i18next'
|
||||
import copy from 'copy-to-clipboard'
|
||||
import s from './index.module.css'
|
||||
import type { SuccessInvationResult } from '.'
|
||||
import type { SuccessInvitationResult } from '.'
|
||||
import Tooltip from '@/app/components/base/tooltip'
|
||||
import { randomString } from '@/utils'
|
||||
|
||||
type IInvitationLinkProps = {
|
||||
value: SuccessInvationResult
|
||||
value: SuccessInvitationResult
|
||||
}
|
||||
|
||||
const InvitationLink = ({
|
||||
|
||||
@@ -125,7 +125,7 @@ const WorkflowChecklist = ({
|
||||
<div className='px-3 py-2 bg-gray-25 rounded-b-lg'>
|
||||
<div className='flex text-xs leading-[18px] text-gray-500'>
|
||||
<AlertTriangle className='mt-[3px] mr-2 w-3 h-3 text-[#F79009]' />
|
||||
{t('workflow.common.needConnecttip')}
|
||||
{t('workflow.common.needConnectTip')}
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
||||
@@ -138,7 +138,7 @@ export const useChecklistBeforePublish = () => {
|
||||
}
|
||||
|
||||
if (!validNodes.find(n => n.id === node.id)) {
|
||||
notify({ type: 'error', message: `[${node.data.title}] ${t('workflow.common.needConnecttip')}` })
|
||||
notify({ type: 'error', message: `[${node.data.title}] ${t('workflow.common.needConnectTip')}` })
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ const FormItem: FC<Props> = ({
|
||||
type="text"
|
||||
value={value || ''}
|
||||
onChange={e => onChange(e.target.value)}
|
||||
placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
||||
placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
||||
autoFocus={autoFocus}
|
||||
/>
|
||||
)
|
||||
@@ -117,7 +117,7 @@ const FormItem: FC<Props> = ({
|
||||
type="number"
|
||||
value={value || ''}
|
||||
onChange={e => onChange(e.target.value)}
|
||||
placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
||||
placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
||||
autoFocus={autoFocus}
|
||||
/>
|
||||
)
|
||||
@@ -129,7 +129,7 @@ const FormItem: FC<Props> = ({
|
||||
className="w-full px-3 py-1 text-sm leading-[18px] text-gray-900 border-0 rounded-lg grow h-[120px] bg-gray-50 focus:outline-none focus:ring-1 focus:ring-inset focus:ring-gray-200"
|
||||
value={value || ''}
|
||||
onChange={e => onChange(e.target.value)}
|
||||
placeholder={t('appDebug.variableConig.inputPlaceholder')!}
|
||||
placeholder={t('appDebug.variableConfig.inputPlaceholder')!}
|
||||
autoFocus={autoFocus}
|
||||
/>
|
||||
)
|
||||
@@ -207,7 +207,7 @@ const FormItem: FC<Props> = ({
|
||||
key={index}
|
||||
isInNode
|
||||
value={item}
|
||||
title={<span>{t('appDebug.variableConig.content')} {index + 1} </span>}
|
||||
title={<span>{t('appDebug.variableConfig.content')} {index + 1} </span>}
|
||||
onChange={handleArrayItemChange(index)}
|
||||
headerRight={
|
||||
(value as any).length > 1
|
||||
|
||||
@@ -99,7 +99,7 @@ const AddExtractParameter: FC<Props> = ({
|
||||
if (!param.name)
|
||||
errMessage = t(`${errorI18nPrefix}.fieldRequired`, { field: t(`${i18nPrefix}.addExtractParameterContent.name`) })
|
||||
if (!errMessage && param.type === ParamType.select && (!param.options || param.options.length === 0))
|
||||
errMessage = t(`${errorI18nPrefix}.fieldRequired`, { field: t('appDebug.variableConig.options') })
|
||||
errMessage = t(`${errorI18nPrefix}.fieldRequired`, { field: t('appDebug.variableConfig.options') })
|
||||
if (!errMessage && !param.description)
|
||||
errMessage = t(`${errorI18nPrefix}.fieldRequired`, { field: t(`${i18nPrefix}.addExtractParameterContent.description`) })
|
||||
|
||||
@@ -160,7 +160,7 @@ const AddExtractParameter: FC<Props> = ({
|
||||
/>
|
||||
</Field>
|
||||
{param.type === ParamType.select && (
|
||||
<Field title={t('appDebug.variableConig.options')}>
|
||||
<Field title={t('appDebug.variableConfig.options')}>
|
||||
<ConfigSelect options={param.options || []} onChange={handleParamChange('options')} />
|
||||
</Field>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user