vue-gettext-extract

0.1.6 • Public • Published

vue-gettext-extract

Generates gettext pot files for standard Vue projects

Designed to be used with vue-gettext and nuxt-gettext

Install

npm install -D vue-gettext-extract

Usage

Usage in terminal

cd /my/project/dir/
vue-gettext-extract --help
Options:
  --version   Show version number                                      [boolean]
  --js, -j    Glob pattern for JS files            [string] [default: "**/*.js"]
  --vue, -v   Glob pattern for Vue files          [string] [default: "**/*.vue"]
  --out, -o   Path to output pot file         [string] [default: "template.pot"]
  --help, -h  Show help                                                [boolean]

Usage in code

const extract = require('vue-gettext-extract')
 
async function run() {
  const extractor = await extract('src/**/*.js', 'src/**/*.vue', 'locale/template.pot')
  extractor.printStats()
}

Most of the code is thanks to gettext-extractor and this gist

Readme

Keywords

Package Sidebar

Install

npm i vue-gettext-extract

Weekly Downloads

68

Version

0.1.6

License

GPL-3.0-or-later

Unpacked Size

45.9 kB

Total Files

7

Last publish

Collaborators

  • lajosbencz