dify/web/app/components/i18n-server.tsx

23 lines
441 B
TypeScript
Raw Normal View History

2023-05-15 08:51:32 +08:00
import React from 'react'
import I18N from './i18n'
import { ToastProvider } from './base/toast'
2024-01-11 11:08:32 +08:00
import { getLocaleOnServer } from '@/i18n/server'
2023-05-15 08:51:32 +08:00
export type II18NServerProps = {
children: React.ReactNode
}
2024-05-30 18:58:08 +08:00
const I18NServer = ({
2023-05-15 08:51:32 +08:00
children,
}: II18NServerProps) => {
const locale = getLocaleOnServer()
return (
2024-01-11 11:08:32 +08:00
<I18N {...{ locale }}>
2023-05-15 08:51:32 +08:00
<ToastProvider>{children}</ToastProvider>
</I18N>
)
}
export default I18NServer