react-intlayer
Version:
Easily internationalize i18n your React applications with type-safe multilingual content management.
17 lines (15 loc) • 746 B
JavaScript
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) => {
return require_getDictionary.getDictionary(dictionary, locale ?? require_server_serverContext.getServerContext(require_server_IntlayerServerProvider.IntlayerServerContext));
};
//#endregion
exports.useDictionary = useDictionary;
//# sourceMappingURL=useDictionary.cjs.map