UNPKG

@jsverse/transloco-keys-manager

Version:

Extract translatable keys from projects that uses Transloco

15 lines 656 B
import fs from 'fs-extra'; import { createTranslation } from './utils/create-translation.js'; import { getCurrentTranslation } from './utils/get-current-translation.js'; export function buildTranslationFile({ path, translation = {}, replace = false, removeExtraKeys = false, fileFormat, }) { const currentTranslation = getCurrentTranslation({ path, fileFormat }); fs.outputFileSync(path, createTranslation({ currentTranslation, translation, replace, removeExtraKeys, fileFormat, })); return { type: currentTranslation ? 'modified' : 'new', path }; } //# sourceMappingURL=build-translation-file.js.map