chore: 18n

feat/enchance-prompt-and-code-fe
Joel 7 months ago
parent 7907235124
commit d82abbef23

@ -44,6 +44,7 @@ import type { Node, NodeOutPutVar } from '@/app/components/workflow/types'
import type { GeneratorType } from './types'
import { ArrowDownRoundFill } from '@/app/components/base/icons/src/vender/solid/general'
const i18nPrefix = 'appDebug.generate'
export type IGetAutomaticResProps = {
mode: AppType
isShow: boolean
@ -310,14 +311,14 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
className='mb-1.5 flex cursor-pointer items-center text-sm font-medium leading-5 text-text-primary'
onClick={toggleFoldIdeaOutput}
>
<div className='system-sm-semibold-uppercase mr-1 text-text-secondary'>Idea output</div>
<div className='system-xs-regular text-text-tertiary'>(option)</div>
<div className='system-sm-semibold-uppercase mr-1 text-text-secondary'>{t(`${i18nPrefix}.ideaOutput`)}</div>
<div className='system-xs-regular text-text-tertiary'>({t(`${i18nPrefix}.optional`)})</div>
<ArrowDownRoundFill className={cn('size text-text-quaternary', isFoldIdeaOutput && 'relative top-[1px] rotate-[-90deg]')} />
</div>
{ !isFoldIdeaOutput && (
<Textarea
className="h-[80px]"
placeholder={'Describe your ideal response format, length, tone, and content requirements...'}
placeholder={t(`${i18nPrefix}.ideaOutputPlaceholder`)}
value={ideaOutput}
onChange={e => setIdeaOutput(e.target.value)}
/>
@ -325,7 +326,7 @@ const GetAutomaticRes: FC<IGetAutomaticResProps> = ({
</div>
<div className='mt-7 flex justify-end space-x-2'>
<Button>Dismiss(i18n)</Button>
<Button onClick={onClose}>{t(`${i18nPrefix}.dismiss`)}</Button>
<Button
className='flex space-x-1'
variant='primary'

@ -18,9 +18,7 @@ type Props = {
generatorType: GeneratorType
}
const placeholder = `
`
const i18nPrefix = 'appDebug.generate'
const InstructionEditor: FC<Props> = ({
generatorType,
@ -34,11 +32,11 @@ const InstructionEditor: FC<Props> = ({
const getVarType = useWorkflowVariableType()
const placeholder = (
<div className='system-sm-regular text-text-placeholder'>
<div className='leading-6'>Describe how you would like to improve this Prompt. For example:</div>
<div className='leading-6'>{t(`${i18nPrefix}.instructionPlaceHolderTitle`)}</div>
<div className='mt-2'>
<div>Make the output more concise, retaining the core points.</div>
<div>The output format is incorrect, please strictly follow the JSON format.</div>
<div>The tone is too harsh, please make it more friendly.</div>
<div>{t(`${i18nPrefix}.instructionPlaceHolderLine1`)}</div>
<div>{t(`${i18nPrefix}.instructionPlaceHolderLine2`)}</div>
<div>{t(`${i18nPrefix}.instructionPlaceHolderLine3`)}</div>
</div>
</div>
)
@ -50,7 +48,6 @@ const InstructionEditor: FC<Props> = ({
key={controlPromptEditorRerenderKey}
placeholder={placeholder}
placeholderClassName='px-4 pt-3'
// compact
className={cn('min-h-[240px] ')}
value={value}
workflowVariableBlock={{

@ -248,7 +248,14 @@ const translation = {
description: 'The Prompt Generator uses the configured model to optimize prompts for higher quality and better structure. Please write clear and detailed instructions.',
tryIt: 'Try it',
instruction: 'Instructions',
instructionPlaceHolder: 'Write clear and specific instructions.',
instructionPlaceHolderTitle: 'Describe how you would like to improve this Prompt. For example:',
instructionPlaceHolderLine1: 'Make the output more concise, retaining the core points.',
instructionPlaceHolderLine2: 'The output format is incorrect, please strictly follow the JSON format.',
instructionPlaceHolderLine3: 'The tone is too harsh, please make it more friendly.',
ideaOutput: 'Idea Output',
ideaOutputPlaceholder: 'Describe your ideal response format, length, tone, and content requirements...',
optional: 'Optional',
dismiss: 'Dismiss',
generate: 'Generate',
resTitle: 'Generated Prompt',
noDataLine1: 'Describe your use case on the left,',

@ -244,7 +244,14 @@ const translation = {
description: '提示词生成器使用配置的模型来优化提示词,以获得更高的质量和更好的结构。请写出清晰详细的说明。',
tryIt: '试一试',
instruction: '指令',
instructionPlaceHolder: '写下清晰、具体的说明。',
instructionPlaceHolderTitle: '描述您希望如何改进此提示词。例如:',
instructionPlaceHolderLine1: '使输出更简洁,保留核心要点。',
instructionPlaceHolderLine2: '输出格式不正确,请严格遵循 JSON 格式。',
instructionPlaceHolderLine3: '语气过于生硬,请使其更友好。',
ideaOutput: '想法输出',
ideaOutputPlaceholder: '描述您想法的回复格式、长度、语气和内容要求……',
optional: '可选',
dismiss: '取消',
generate: '生成',
resTitle: '生成的提示词',
noDataLine1: '在左侧描述您的用例,',

Loading…
Cancel
Save