0.1.6 • Published 5 years ago
vue-gettext-extract v0.1.6
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