Created
June 14, 2019 11:34
-
-
Save tpinne/d6caa6aaae4bc5a028d4cf17ccc5e5ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// have a look a line 10 and 47 for the relevant changes | |
import * as React from 'react'; | |
import { | |
TransProps, | |
Namespace, | |
// NamespaceExtractor, | |
// WithTranslationOptions, | |
WithTranslation, | |
withTranslation, // new import | |
// Subtract | |
} from 'react-i18next'; | |
import { LinkProps } from 'next-server/link'; | |
import { SingletonRouter } from 'next-server/router'; | |
import i18next from 'i18next'; | |
export type InitConfig = { | |
browserLanguageDetection?: boolean; | |
serverLanguageDetection?: boolean; | |
strictMode?: boolean; | |
defaultLanguage: string; | |
ignoreRoutes?: string[]; | |
localePath?: string; | |
localeStructure?: string; | |
otherLanguages: string[]; | |
localeSubpaths?: "none" | "foreign" | "all"; | |
use?: any[]; | |
customDetectors?: any[]; | |
} & i18next.InitOptions; | |
export type Config = { | |
fallbackLng: boolean; | |
allLanguages: string[]; | |
whitelist: string[]; | |
preload: string[]; | |
} & InitConfig; | |
declare class NextI18Next { | |
Trans: React.ComponentClass<TransProps>; | |
Link: React.ComponentClass<LinkProps>; | |
Router: SingletonRouter; | |
i18n: i18next.i18n; | |
config: Config; | |
constructor(config: InitConfig); | |
withTranslation: typeof withTranslation; | |
appWithTranslation<P extends object>(Component: React.ComponentType<P> | React.ElementType<P>): any; | |
} | |
export default NextI18Next; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment