Skip to content

Commit

Permalink
fix: i18n typo (langgenius#8077)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZuzooVn authored and cuiks committed Sep 26, 2024
1 parent 09459f7 commit d365706
Show file tree
Hide file tree
Showing 145 changed files with 268 additions and 268 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -101,15 +101,15 @@ 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) {
onConfirm(tempPayload, moreInfo)
}
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> = {}
Expand All @@ -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)
Expand All @@ -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)} />
Expand All @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'>
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/base/app-unavailable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
6 changes: 3 additions & 3 deletions web/app/components/datasets/create/step-two/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)}
Expand Down Expand Up @@ -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>
)}
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand All @@ -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}>
Expand All @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ({
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/workflow/header/checklist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>
)
Expand Down
2 changes: 1 addition & 1 deletion web/app/components/workflow/hooks/use-checklist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
/>
)
Expand All @@ -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}
/>
)
Expand All @@ -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}
/>
)
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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`) })

Expand Down Expand Up @@ -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>
)}
Expand Down
2 changes: 1 addition & 1 deletion web/app/signin/oneMoreStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const OneMoreStep = () => {
}
needsDelay
>
<span className='cursor-pointer text-primary-600'>{t('login.donthave')}</span>
<span className='cursor-pointer text-primary-600'>{t('login.dontHave')}</span>
</Tooltip>
</label>
<div className="mt-1">
Expand Down
2 changes: 1 addition & 1 deletion web/i18n/de-DE/app-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const translation = {
play: 'Abspielen',
pause: 'Pause',
playing: 'Wiedergabe',
merMaind: {
merMaid: {
rerender: 'Neu rendern',
},
never: 'Nie',
Expand Down
Loading

0 comments on commit d365706

Please sign in to comment.