mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 18:08:07 +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:
@ -17,7 +17,7 @@ import checkTaskStatus from '../../base/check-task-status'
|
||||
import Version from '../../base/version'
|
||||
import { pluginManifestToCardPluginProps } from '../../utils'
|
||||
|
||||
const i18nPrefix = 'plugin.installModal'
|
||||
const i18nPrefix = 'installModal'
|
||||
|
||||
type Props = {
|
||||
uniqueIdentifier: string
|
||||
@ -118,7 +118,7 @@ const Installed: FC<Props> = ({
|
||||
<>
|
||||
<div className="flex flex-col items-start justify-center gap-4 self-stretch px-6 py-3">
|
||||
<div className="system-md-regular text-text-secondary">
|
||||
<p>{t(`${i18nPrefix}.readyToInstall`)}</p>
|
||||
<p>{t(`${i18nPrefix}.readyToInstall`, { ns: 'plugin' })}</p>
|
||||
<p>
|
||||
<Trans
|
||||
i18nKey={`${i18nPrefix}.fromTrustSource`}
|
||||
@ -127,7 +127,7 @@ const Installed: FC<Props> = ({
|
||||
</p>
|
||||
{!isDifyVersionCompatible && (
|
||||
<p className="system-md-regular flex items-center gap-1 text-text-warning">
|
||||
{t('plugin.difyVersionNotCompatible', { minimalDifyVersion: payload.meta.minimum_dify_version })}
|
||||
{t('difyVersionNotCompatible', { ns: 'plugin', minimalDifyVersion: payload.meta.minimum_dify_version })}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
@ -149,7 +149,7 @@ const Installed: FC<Props> = ({
|
||||
<div className="flex items-center justify-end gap-2 self-stretch p-6 pt-5">
|
||||
{!isInstalling && (
|
||||
<Button variant="secondary" className="min-w-[72px]" onClick={handleCancel}>
|
||||
{t('common.operation.cancel')}
|
||||
{t('operation.cancel', { ns: 'common' })}
|
||||
</Button>
|
||||
)}
|
||||
<Button
|
||||
@ -159,7 +159,7 @@ const Installed: FC<Props> = ({
|
||||
onClick={handleInstall}
|
||||
>
|
||||
{isInstalling && <RiLoader2Line className="h-4 w-4 animate-spin-slow" />}
|
||||
<span>{t(`${i18nPrefix}.${isInstalling ? 'installing' : 'install'}`)}</span>
|
||||
<span>{t(`${i18nPrefix}.${isInstalling ? 'installing' : 'install'}`, { ns: 'plugin' })}</span>
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
|
||||
@ -8,7 +8,7 @@ import Button from '@/app/components/base/button'
|
||||
import { uploadFile } from '@/service/plugins'
|
||||
import Card from '../../../card'
|
||||
|
||||
const i18nPrefix = 'plugin.installModal'
|
||||
const i18nPrefix = 'installModal'
|
||||
|
||||
type Props = {
|
||||
isBundle: boolean
|
||||
@ -64,6 +64,7 @@ const Uploading: FC<Props> = ({
|
||||
<RiLoader2Line className="h-4 w-4 animate-spin-slow text-text-accent" />
|
||||
<div className="system-md-regular text-text-secondary">
|
||||
{t(`${i18nPrefix}.uploadingPackage`, {
|
||||
ns: 'plugin',
|
||||
packageName: fileName,
|
||||
})}
|
||||
</div>
|
||||
@ -82,14 +83,14 @@ const Uploading: FC<Props> = ({
|
||||
{/* Action Buttons */}
|
||||
<div className="flex items-center justify-end gap-2 self-stretch p-6 pt-5">
|
||||
<Button variant="secondary" className="min-w-[72px]" onClick={onCancel}>
|
||||
{t('common.operation.cancel')}
|
||||
{t('operation.cancel', { ns: 'common' })}
|
||||
</Button>
|
||||
<Button
|
||||
variant="primary"
|
||||
className="min-w-[72px]"
|
||||
disabled
|
||||
>
|
||||
{t(`${i18nPrefix}.install`)}
|
||||
{t(`${i18nPrefix}.install`, { ns: 'plugin' })}
|
||||
</Button>
|
||||
</div>
|
||||
</>
|
||||
|
||||
Reference in New Issue
Block a user