mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 09:58:04 +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:
@ -76,7 +76,7 @@ const CrawledResultItem = ({
|
||||
onClick={onPreview}
|
||||
className="system-xs-medium-uppercase right-2 top-2 hidden px-1.5 group-hover:absolute group-hover:block"
|
||||
>
|
||||
{t('datasetCreation.stepOne.website.preview')}
|
||||
{t('stepOne.website.preview', { ns: 'datasetCreation' })}
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@ -7,7 +7,7 @@ import { cn } from '@/utils/classnames'
|
||||
import CheckboxWithLabel from './checkbox-with-label'
|
||||
import CrawledResultItem from './crawled-result-item'
|
||||
|
||||
const I18N_PREFIX = 'datasetCreation.stepOne.website'
|
||||
const I18N_PREFIX = 'stepOne.website'
|
||||
|
||||
type CrawledResultProps = {
|
||||
className?: string
|
||||
@ -66,6 +66,7 @@ const CrawledResult = ({
|
||||
<div className={cn('flex flex-col gap-y-2', className)}>
|
||||
<div className="system-sm-medium pt-2 text-text-primary">
|
||||
{t(`${I18N_PREFIX}.scrapTimeInfo`, {
|
||||
ns: 'datasetCreation',
|
||||
total: list.length,
|
||||
time: usedTime.toFixed(1),
|
||||
})}
|
||||
@ -76,7 +77,7 @@ const CrawledResult = ({
|
||||
<CheckboxWithLabel
|
||||
isChecked={isCheckAll}
|
||||
onChange={handleCheckedAll}
|
||||
label={isCheckAll ? t(`${I18N_PREFIX}.resetAll`) : t(`${I18N_PREFIX}.selectAll`)}
|
||||
label={isCheckAll ? t(`${I18N_PREFIX}.resetAll`, { ns: 'datasetCreation' }) : t(`${I18N_PREFIX}.selectAll`, { ns: 'datasetCreation' })}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@ -66,7 +66,7 @@ const Crawling = ({
|
||||
return (
|
||||
<div className={cn('mt-2 flex flex-col gap-y-2 pt-2', className)}>
|
||||
<div className="system-sm-medium text-text-primary">
|
||||
{t('datasetCreation.stepOne.website.totalPageScraped')}
|
||||
{t('stepOne.website.totalPageScraped', { ns: 'datasetCreation' })}
|
||||
{' '}
|
||||
{crawledNum}
|
||||
/
|
||||
|
||||
@ -13,7 +13,7 @@ import { useConfigurations, useInitialData } from '@/app/components/rag-pipeline
|
||||
import { CrawlStep } from '@/models/datasets'
|
||||
import { cn } from '@/utils/classnames'
|
||||
|
||||
const I18N_PREFIX = 'datasetCreation.stepOne.website'
|
||||
const I18N_PREFIX = 'stepOne.website'
|
||||
|
||||
type OptionsProps = {
|
||||
variables: RAGPipelineVariables
|
||||
@ -89,7 +89,7 @@ const Options = ({
|
||||
onClick={foldToggle}
|
||||
>
|
||||
<span className="system-sm-semibold-uppercase text-text-secondary">
|
||||
{t(`${I18N_PREFIX}.options`)}
|
||||
{t(`${I18N_PREFIX}.options`, { ns: 'datasetCreation' })}
|
||||
</span>
|
||||
<ArrowDownRoundFill className={cn('h-4 w-4 shrink-0 text-text-quaternary', fold && '-rotate-90')} />
|
||||
</div>
|
||||
@ -102,7 +102,7 @@ const Options = ({
|
||||
spinnerClassName="!ml-0"
|
||||
>
|
||||
<RiPlayLargeLine className="size-4" />
|
||||
<span className="px-0.5">{!isRunning ? t(`${I18N_PREFIX}.run`) : t(`${I18N_PREFIX}.running`)}</span>
|
||||
<span className="px-0.5">{!isRunning ? t(`${I18N_PREFIX}.run`, { ns: 'datasetCreation' }) : t(`${I18N_PREFIX}.running`, { ns: 'datasetCreation' })}</span>
|
||||
</Button>
|
||||
</div>
|
||||
{!fold && (
|
||||
|
||||
Reference in New Issue
Block a user