mirror of
http://112.124.100.131/huang.ze/ebiz-dify-ai.git
synced 2025-12-24 18:23:07 +08:00
Initial commit
This commit is contained in:
25
web/app/components/i18n-server.tsx
Normal file
25
web/app/components/i18n-server.tsx
Normal file
@@ -0,0 +1,25 @@
|
||||
import React from 'react'
|
||||
import I18N from './i18n'
|
||||
import { ToastProvider } from './base/toast'
|
||||
import { getDictionary, getLocaleOnServer } from '@/i18n/server'
|
||||
|
||||
export type II18NServerProps = {
|
||||
// locale: Locale
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
const I18NServer = async ({
|
||||
// locale,
|
||||
children,
|
||||
}: II18NServerProps) => {
|
||||
const locale = getLocaleOnServer()
|
||||
const dictionary = await getDictionary(locale)
|
||||
|
||||
return (
|
||||
<I18N {...{ locale, dictionary }}>
|
||||
<ToastProvider>{children}</ToastProvider>
|
||||
</I18N>
|
||||
)
|
||||
}
|
||||
|
||||
export default I18NServer
|
||||
Reference in New Issue
Block a user