Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extraction fails with gettext 0.21 #128

Open
georgkrause opened this issue Apr 12, 2021 · 3 comments
Open

Extraction fails with gettext 0.21 #128

georgkrause opened this issue Apr 12, 2021 · 3 comments

Comments

@georgkrause
Copy link

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
Copy link

7iomka commented Jul 15, 2021

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
Copy link
Author

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
Copy link

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):

  • brew install nedap/versions/gettext@0.20.2 (big thanks @nedap!). Make sure you have the latest xcode-select installed for this to be able to be compiled

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

  • brew link --overwrite --force gettext@0.20.2

If you still get another version as linked, run:

  • gettext --version to double-check what version is active.
  • echo $PATH to see if gettext is in your $PATH. If it is, remove it from there so that brew's version can be used instead.
  • Then open a new terminal window to make sure it has loaded the new $PATH.
  • Voilà! gettext --version should now be returning gettext (GNU gettext-runtime) 0.20.2 and hopefully this can run your scripts again!

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants