I’ve been researching on how to translate my vue project but I’m getting kinda stuck. I’ve been asked to create a .po file (that I can then use in poedit or something similar).
I’ve tried implementing vue-gettext but I’m a bit confused on how to work it. I’ve added easygettext as needed but I keep getting module errors:
./node_modules/easygettext/src/extract-cli.js
Module parse failed: Unexpected character '#' (1:0)
I tried to fix it by adding BannerPlugin(as per this suggestion: How to keep my shebang in place using webpack?) in both webpack.dev.conf.js
and webpack.prod.conf.js
:
require('webpack').BannerPlugin
plugins: [
new webpack.BannerPlugin({ banner: "#!/usr/bin/env node", raw: true }),
...
but I'm still having the error.
additionally, it seems I need a translations.json file to use the vue-gettext
plugin but it also looks like the translations.json is created after by gettext-compile so I'm unsure if I'm supposed to first create a json file of translations or what is needed.
So I’m wondering if anybody knows how to setup vue-gettext properly or if there are any alternatives to create .po files?
Thanks so much!