How to use the easygettext/src/compile.po2json 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 / compile.js View on Github external
poFiles.forEach((poFile) => {
  let poContents = fs.readFileSync(poFile, {
    encoding: 'utf-8'
  }).toString()
  let data = po2json(poContents)
  let lang = data.headers.Language

  if (!translationData[lang]) {
    translationData[lang] = data.messages
  } else {
    Object.assign(translationData[lang], data.messages)
  }
})

easygettext

Simple tools to extract gettext strings

MIT
Latest version published 4 years ago

Package Health Score

57 / 100
Full package analysis

Similar packages