You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
overseerr/src/context/LanguageContext.tsx

32 lines
526 B

import React, { ReactNode } from 'react';
export type AvailableLocales =
| 'ca'
| 'de'
| 'en'
| 'es'
| 'it'
| 'ja'
| 'fr'
| 'hu'
| 'nb-NO'
| 'nl'
| 'pt-BR'
| 'pt-PT'
| 'ru'
| 'sr'
| 'sv'
| 'zh-TW';
interface LanguageContextProps {
locale: AvailableLocales;
children: (locale: string) => ReactNode;
setLocale?: React.Dispatch<React.SetStateAction<AvailableLocales>>;
}
export const LanguageContext = React.createContext<
Omit<LanguageContextProps, 'children'>
>({
locale: 'en',
});