UNPKG

react-intlayer

Version:

Easily internationalize i18n your React applications with type-safe multilingual content management.

13 lines 458 B
"use client"; import { useContext } from "react"; import { getDictionary } from "../getDictionary.mjs"; import { IntlayerClientContext } from "./IntlayerProvider.mjs"; const useDictionary = (dictionary, locale) => { const { locale: currentLocale } = useContext(IntlayerClientContext); const localeTarget = locale ?? currentLocale; return getDictionary(dictionary, localeTarget); }; export { useDictionary }; //# sourceMappingURL=useDictionary.mjs.map