sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
27 lines (23 loc) • 508 B
text/typescript
import type {i18n} from 'i18next'
import {createContext} from 'sanity/_createContext'
import type {Locale} from '../../core/i18n/types'
/**
* @internal
* @hidden
*/
export interface LocaleContextValue {
locales: Locale[]
currentLocale: Locale
__internal: {
i18next: i18n
}
changeLocale: (newLocale: string) => Promise<void>
}
/**
* @internal
* @hidden
*/
export const LocaleContext = createContext<LocaleContextValue | undefined>(
'sanity/_singletons/context/locale',
undefined,
)