remix-i18next
Version:
The easiest way to translate your Full Stack React Router apps
24 lines (23 loc) • 1.13 kB
TypeScript
import type { InitOptions, i18n, Module, NewableModule } from "i18next";
import type { unstable_MiddlewareFunction, unstable_RouterContextProvider } from "react-router";
import type { LanguageDetectorOption } from "./lib/language-detector.js";
export declare function unstable_createI18nextMiddleware({ detection, i18next, plugins, }: unstable_createI18nextMiddleware.Options): unstable_createI18nextMiddleware.ReturnType;
export declare namespace unstable_createI18nextMiddleware {
interface Options {
/**
* The i18next options used to initialize the internal i18next instance.
*/
i18next?: Omit<InitOptions, "detection">;
/**
* The i18next plugins used to extend the internal i18next instance
* when creating a new TFunction.
*/
plugins?: NewableModule<Module>[] | Module[];
detection: LanguageDetectorOption;
}
type ReturnType = [
unstable_MiddlewareFunction<Response>,
(context: Readonly<unstable_RouterContextProvider>) => string,
(context: Readonly<unstable_RouterContextProvider>) => i18n
];
}