11 lines
276 B
TypeScript
11 lines
276 B
TypeScript
import { createContext } from 'react'
|
|
import type { Locale } from './translations'
|
|
|
|
export type I18nContextValue = {
|
|
locale: Locale
|
|
setLocale: (locale: Locale) => void
|
|
t: (key: string) => string
|
|
}
|
|
|
|
export const I18nContext = createContext<I18nContextValue | null>(null)
|