Variable connectI18nextConst

connectI18next: { init: (i18next: any) => void; type: "3rdParty" } = ...

Bind the locale state to i18next, so whenever setLocale is called, it will also call i18next.changeLanguage.

Example

import i18next from "i18next";
import { connectI18next, initLocale } from "@pistonite/pure/pref";

initLocale({ supported: ["en", "es"], default: "en", persist: true });
i18next.use(connectI18next).init({
// ...options

Type declaration

  • init: (i18next: any) => void
  • type: "3rdParty"