@rcooler/react-i18n
createI18n(dictionaries): a provider and a hook that give React components the translator of
@rcooler/i18n-core and a language switch.
React 19.3 is a peer dependency.
npm install @rcooler/react-i18n
import { createI18n } from "@rcooler/react-i18n";
const en = { "nav.home": "Home", "error.unknown": "Something went wrong." };
const uk = { "nav.home": "Головна", "error.unknown": "Щось пішло не так." };
export const { I18nProvider, useI18n } = createI18n({ en, uk }, { storageKey: "app.locale" });
ESM with type declarations. Part of web-kit: the
README there describes every package, and the
changelog lists the changes.
Licence
MIT