@intlayer/core
Version:
Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.
24 lines (22 loc) • 814 B
JavaScript
import { getContent } from "./getContent/getContent.mjs";
//#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) => {
const props = {
dictionaryKey: dictionary.key,
dictionaryPath: dictionary.filePath,
keyPath: [],
plugins
};
return getContent(dictionary.content, props, locale);
};
//#endregion
export { getDictionary };
//# sourceMappingURL=getDictionary.mjs.map