Polyconseil / vue-gettext

Translate your Vue.js applications with gettext.
MIT License
278 stars 55 forks source link

Extraction fails with gettext 0.21 #128

Open georgkrause opened 3 years ago

georgkrause commented 3 years ago

While the extraction works fine with 0.19, I start getting problems with v0.21.

xgettext --language=JavaScript --keyword=npgettext:1c,2,3 --from-code=utf-8 --join-existing --no-wrap --package-name=$(node -e "console.log(require('./package.json').name);") --package-version=$(node -e "console.log(require('./package.json').version);") --output $locales_dir/app.pot src/App.vue --no-wrap 
xgettext: Öffnen der Datei »/app.pot« zum Lesen fehlgeschlagen: Datei oder Verzeichnis nicht gefunden

(Sorry for the german error message)

The file in question is available here: https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/front/src/App.vue

7iomka commented 3 years ago

While the extraction works fine with 0.19, I start getting problems with v0.21.

xgettext --language=JavaScript --keyword=npgettext:1c,2,3 --from-code=utf-8 --join-existing --no-wrap --package-name=$(node -e "console.log(require('./package.json').name);") --package-version=$(node -e "console.log(require('./package.json').version);") --output $locales_dir/app.pot src/App.vue --no-wrap 
xgettext: Öffnen der Datei »/app.pot« zum Lesen fehlgeschlagen: Datei oder Verzeichnis nicht gefunden

(Sorry for the german error message)

The file in question is available here: https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/front/src/App.vue

Hi You resolved your issue? I read your docs https://dev.funkwhale.audio/funkwhale/funkwhale/-/blob/develop/CONTRIBUTING.rst I have error: scripts/i18n-extract.sh: line 15: xgettext: command not found error Command failed with exit code 127.

image

Is the same error?

georgkrause commented 3 years ago

Hello!

I did not solved it, I simply work around it by using gettext version 0.19.

Anyway, the errors are not the same. The one I reported is like Failed to open File "/app.pot" for reading: File or directory not found

Knogobert commented 2 years ago

Oh my colleague and I have been sitting way too much on trying to fix this.


I finally solved it by downgrading to gettext 0.20.2

Steps I took (on macOS Big Sur):

If you run into brew linking issues like me, run:

If you still get another version as linked, run:


At the time of writing this, my colleague found another solution.

He updated the xgettext line to run via gettext-extract instead, and removed a bunch of unusable flags.

From e.g.

xgettext --language=JavaScript --keyword=npgettext:1c,2,3 --from-code=utf-8 --join-existing --no-wrap --package-name=$(node -e "console.log(require('./package.json').name);") --package-version=$(node -e "console.log(require('./package.json').version);") --output $locales_dir/app.pot src/App.vue --no-wrap 

To e.g.

xgettext --output $locales_dir/app.pot src/App.vue

But it's not really fully functioning properly yet, it doesn’t seem to --join-existing. Will update if we manage to use this solution. For now we will unfortunately downgrade.