mirror of
https://github.com/langgenius/dify.git
synced 2026-05-06 10:28:10 +08:00
refactor(i18n): use JSON with flattened key and namespace (#30114)
Co-authored-by: yyh <yuanyouhuilyz@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -90,7 +90,7 @@ const AgentLogDetail: FC<AgentLogDetailProps> = ({
|
||||
)}
|
||||
onClick={() => switchTab('DETAIL')}
|
||||
>
|
||||
{t('runLog.detail')}
|
||||
{t('detail', { ns: 'runLog' })}
|
||||
</div>
|
||||
<div
|
||||
className={cn(
|
||||
@ -99,7 +99,7 @@ const AgentLogDetail: FC<AgentLogDetailProps> = ({
|
||||
)}
|
||||
onClick={() => switchTab('TRACING')}
|
||||
>
|
||||
{t('runLog.tracing')}
|
||||
{t('tracing', { ns: 'runLog' })}
|
||||
</div>
|
||||
</div>
|
||||
{/* panel detail */}
|
||||
|
||||
@ -45,7 +45,7 @@ const AgentLogModal: FC<AgentLogModalProps> = ({
|
||||
}}
|
||||
ref={ref}
|
||||
>
|
||||
<h1 className="text-md shrink-0 px-4 py-1 font-semibold text-text-primary">{t('appLog.runDetail.workflowTitle')}</h1>
|
||||
<h1 className="text-md shrink-0 px-4 py-1 font-semibold text-text-primary">{t('runDetail.workflowTitle', { ns: 'appLog' })}</h1>
|
||||
<span className="absolute right-3 top-4 z-20 cursor-pointer p-1" onClick={onCancel}>
|
||||
<RiCloseLine className="h-4 w-4 text-text-tertiary" />
|
||||
</span>
|
||||
|
||||
@ -19,10 +19,10 @@ const Iteration: FC<Props> = ({ iterationInfo, isFinal, index }) => {
|
||||
<div className={cn('px-4 py-2')}>
|
||||
<div className="flex items-center">
|
||||
{isFinal && (
|
||||
<div className="mr-3 shrink-0 text-xs font-semibold leading-[18px] text-text-tertiary">{t('appLog.agentLogDetail.finalProcessing')}</div>
|
||||
<div className="mr-3 shrink-0 text-xs font-semibold leading-[18px] text-text-tertiary">{t('agentLogDetail.finalProcessing', { ns: 'appLog' })}</div>
|
||||
)}
|
||||
{!isFinal && (
|
||||
<div className="mr-3 shrink-0 text-xs font-semibold leading-[18px] text-text-tertiary">{`${t('appLog.agentLogDetail.iteration').toUpperCase()} ${index}`}</div>
|
||||
<div className="mr-3 shrink-0 text-xs font-semibold leading-[18px] text-text-tertiary">{`${t('agentLogDetail.iteration', { ns: 'appLog' }).toUpperCase()} ${index}`}</div>
|
||||
)}
|
||||
<Divider bgStyle="gradient" className="mx-0 h-px grow" />
|
||||
</div>
|
||||
|
||||
@ -66,52 +66,52 @@ const ResultPanel: FC<ResultPanelProps> = ({
|
||||
</div>
|
||||
<div className="px-4 py-2">
|
||||
<div className="relative">
|
||||
<div className="h-6 text-xs font-medium leading-6 text-text-tertiary">{t('runLog.meta.title')}</div>
|
||||
<div className="h-6 text-xs font-medium leading-6 text-text-tertiary">{t('meta.title', { ns: 'runLog' })}</div>
|
||||
<div className="py-1">
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('runLog.meta.status')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('meta.status', { ns: 'runLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>SUCCESS</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('runLog.meta.executor')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('meta.executor', { ns: 'runLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{created_by || 'N/A'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('runLog.meta.startTime')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('meta.startTime', { ns: 'runLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{formatTime(Date.parse(created_at) / 1000, t('appLog.dateTimeFormat') as string)}</span>
|
||||
<span>{formatTime(Date.parse(created_at) / 1000, t('dateTimeFormat', { ns: 'appLog' }) as string)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('runLog.meta.time')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('meta.time', { ns: 'runLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{`${elapsed_time?.toFixed(3)}s`}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('runLog.meta.tokens')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('meta.tokens', { ns: 'runLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{`${total_tokens || 0} Tokens`}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('appLog.agentLogDetail.agentMode')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('agentLogDetail.agentMode', { ns: 'appLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{agentMode === 'function_call' ? t('appDebug.agent.agentModeType.functionCall') : t('appDebug.agent.agentModeType.ReACT')}</span>
|
||||
<span>{agentMode === 'function_call' ? t('agent.agentModeType.functionCall', { ns: 'appDebug' }) : t('agent.agentModeType.ReACT', { ns: 'appDebug' })}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('appLog.agentLogDetail.toolUsed')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('agentLogDetail.toolUsed', { ns: 'appLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{tools?.length ? tools?.join(', ') : 'Null'}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex">
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('appLog.agentLogDetail.iterations')}</div>
|
||||
<div className="w-[104px] shrink-0 truncate px-2 py-[5px] text-xs leading-[18px] text-text-tertiary">{t('agentLogDetail.iterations', { ns: 'appLog' })}</div>
|
||||
<div className="grow px-2 py-[5px] text-xs leading-[18px] text-text-primary">
|
||||
<span>{iterations}</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user