dify/web/context/i18n.ts

19 lines
484 B
TypeScript
Raw Normal View History

2023-05-15 08:51:32 +08:00
import { createContext } from 'use-context-selector'
import type { Locale } from '@/i18n'
type II18NContext = {
locale: Locale
i18n: Record<string, any>
setLocaleOnClient: (locale: Locale, reloadPage?: boolean) => void
2023-05-15 08:51:32 +08:00
// setI8N: (i18n: Record<string, string>) => void,
}
const I18NContext = createContext<II18NContext>({
locale: 'en',
i18n: {},
setLocaleOnClient: (lang: Locale, reloadPage?: boolean) => { },
2023-05-15 08:51:32 +08:00
// setI8N: () => {},
})
export default I18NContext