i18n.ts 407 B

1234567891011121314151617
  1. import { createContext } from 'use-context-selector'
  2. import type { Locale } from '@/i18n'
  3. type II18NContext = {
  4. locale: Locale
  5. i18n: Record<string, any>
  6. setLocaleOnClient: (locale: Locale, reloadPage?: boolean) => void
  7. }
  8. const I18NContext = createContext<II18NContext>({
  9. locale: 'en-US',
  10. i18n: {},
  11. setLocaleOnClient: (lang: Locale, reloadPage?: boolean) => { },
  12. })
  13. export default I18NContext