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

23 lines
447 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
}
const I18NServer = async ({
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