@intlayer/core
Version:
Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.
25 lines (23 loc) • 1.04 kB
JavaScript
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_interpreter_getContent_getContent = require('./getContent/getContent.cjs');
//#region src/interpreter/getDictionary.ts
/**
* Transforms a dictionary in a single pass, applying each plugin as needed.
*
* @param dictionary The dictionary to transform.
* @param locale The locale to use if your transformers need it (e.g. for translations).
* @param additionalPlugins An array of NodeTransformer that define how to transform recognized nodes.
* If omitted, we’ll use a default set of plugins.
*/
const getDictionary = (dictionary, locale, plugins = require_interpreter_getContent_getContent.getBasePlugins(locale)) => {
const props = {
dictionaryKey: dictionary.key,
dictionaryPath: dictionary.filePath,
keyPath: [],
plugins
};
return require_interpreter_getContent_getContent.getContent(dictionary.content, props, plugins);
};
//#endregion
exports.getDictionary = getDictionary;
//# sourceMappingURL=getDictionary.cjs.map