mirror of
https://github.com/langgenius/dify.git
synced 2026-07-24 04:58:32 +08:00
21 lines
480 B
TypeScript
21 lines
480 B
TypeScript
'use client'
|
|
|
|
import type { Resource } from 'i18next'
|
|
import type { Locale } from '@/i18n-config'
|
|
import { I18nextProvider } from 'react-i18next'
|
|
import { createI18nextInstance } from '@/i18n-config/client'
|
|
|
|
export function I18nClientProvider({
|
|
locale,
|
|
resource,
|
|
children,
|
|
}: {
|
|
locale: Locale
|
|
resource: Resource
|
|
children: React.ReactNode
|
|
}) {
|
|
const i18n = createI18nextInstance(locale, resource)
|
|
|
|
return <I18nextProvider i18n={i18n}>{children}</I18nextProvider>
|
|
}
|