UNPKG

react-intlayer

Version:

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

18 lines (16 loc) 853 B
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const require_getDictionary = require('../getDictionary.cjs'); const require_server_serverContext = require('./serverContext.cjs'); const require_server_IntlayerServerProvider = require('./IntlayerServerProvider.cjs'); //#region src/server/useDictionary.ts /** * On the server side, Hook that transform a dictionary and return the content * * If the locale is not provided, it will use the locale from the server context */ const useDictionary = (dictionary, locale, fallbackLocale) => { return require_getDictionary.getDictionary(dictionary, locale ?? require_server_serverContext.getServerContext(require_server_IntlayerServerProvider.IntlayerServerContext) ?? fallbackLocale); }; //#endregion exports.useDictionary = useDictionary; //# sourceMappingURL=useDictionary.cjs.map