How to use the easygettext/src/constants.DEFAULT_ATTRIBUTES function in easygettext

To help you get started, we’ve selected a few easygettext examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kennyki / vue-webpack-gettext / extract.js View on Github external
.describe('attrs', 'The attributes passed to easygettext extractor.')
  .array('xgettext')
  .describe('xgettext-args', 'The arguments to pass to xgettext command.')
  .demand(['src', 'output'])
  .argv

const outputFile = argv.output
const srcFolder = argv.src
const extractAttrs = argv.attrs
const xgettextArgs = argv.xgettextArgs

// clean up
shell.rm('-f', outputFile)

let finalAttrs = extractAttrs
                ? extractAttrs.concat(ExtractorDefaultAttrs)
                : ExtractorDefaultAttrs

// support v-translate directive
if (finalAttrs.indexOf('v-translate') === -1) {
  finalAttrs.push('v-translate')
}

const extractor = new Extractor({
  lineNumbers: true,
  attributes: finalAttrs
})

const vueFiles = glob.sync(`${srcFolder}/**/*.vue`)

// extract from templates
let renderPromises = vueFiles.map((file) => {

easygettext

Simple tools to extract gettext strings

MIT
Latest version published 4 years ago

Package Health Score

54 / 100
Full package analysis

Similar packages