mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
fix: i18n
This commit is contained in:
parent
9025e85ca5
commit
21b3703bd8
|
@ -10,6 +10,7 @@ import Description from './base/description'
|
|||
import Placeholder from './base/placeholder'
|
||||
import cn from '@/utils/classnames'
|
||||
import { useGetLanguage } from '@/context/i18n'
|
||||
import { getLanguage } from '@/i18n/language'
|
||||
|
||||
export type Props = {
|
||||
className?: string
|
||||
|
@ -39,7 +40,7 @@ const Card = ({
|
|||
locale: localeFromProps,
|
||||
}: Props) => {
|
||||
const defaultLocale = useGetLanguage()
|
||||
const locale = localeFromProps || defaultLocale
|
||||
const locale = localeFromProps ? getLanguage(localeFromProps) : defaultLocale
|
||||
|
||||
const { type, name, org, label, brief, icon, verified } = payload
|
||||
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
import { useTranslation as translate } from '@/i18n/server'
|
||||
import {
|
||||
getLocaleOnServer,
|
||||
useTranslation as translate,
|
||||
} from '@/i18n/server'
|
||||
|
||||
type DescriptionProps = {
|
||||
locale?: string
|
||||
}
|
||||
const Description = async ({
|
||||
locale = 'en-US',
|
||||
locale: localeFromProps,
|
||||
}: DescriptionProps) => {
|
||||
const { t } = await translate(locale, 'plugin')
|
||||
const localeDefault = getLocaleOnServer()
|
||||
const { t } = await translate(localeFromProps || localeDefault, 'plugin')
|
||||
|
||||
return (
|
||||
<>
|
||||
|
|
Loading…
Reference in New Issue
Block a user