import { deepTransformNode } from "../interpreter/getContent/deepTransform.mjs";
import { translationPlugin } from "../interpreter/getContent/plugins.mjs";

//#region ../@intlayer/webpack/dist/esm/chokidar/dist/esm/core/dist/esm/deepTransformPlugins/getLocalizedContent.mjs
/**
* Transforms a node in a single pass, applying each plugin as needed.
* In comparison to `getContent`, this function will only apply the translation plugin.
* It will not transform enumerations, insertions, or other content types.
*
* @param node The node to transform.
* @param locale The locale to use if your transformers need it (e.g. for translations).
*/
const getLocalizedContent = (node, locale, nodeProps, fallback) => {
	const plugins = [translationPlugin(locale, fallback), ...nodeProps.plugins ?? []];
	return deepTransformNode(node, {
		...nodeProps,
		plugins
	});
};
const getPerLocaleDictionary = (dictionary, locale, fallback) => ({
	...dictionary,
	locale,
	content: getLocalizedContent(dictionary.content, locale, {
		dictionaryKey: dictionary.key,
		keyPath: [],
		plugins: []
	}, fallback)
});

//#endregion
export { getPerLocaleDictionary };
//# sourceMappingURL=getLocalizedContent.mjs.map