0

I've downloaded Poedit, and am attempting to parse my Twig templates. A few tutorials online pointed to https://github.com/umpirsky/Twig-Gettext-Extractor which I later found was referenced in a tutorial here http://aromatix.fr/?p=611 (French) with full instructions.

I got the tutorial done, installed umpirsky/twig-gettext-extractor, and when it tries to build the catalog it dies with "cannot execute program". The error popup contains this command:

/path/to/twig-gettext-extractor --sort-output --force-po -o "/var/folders/lw/0f57k9dj617_ntr760qw2lcr0000gp/T/poeditNoXV1p/3extracted.pot" --from-code=UTF-8  -k_ -ktranslate -ksetLabel -ksetValue -ksetLegend -k_refresh -L PHP --files  "vendor/module/core/view/ldp/forgot/email.twig" "vendor/module/core/view/ldp/forgot/index.twig" "vendor/module/core/view/ldp/login/index.twig" "vendor/module/core/view/ldp/main/index.twig" "vendor/module/core/view/ldp/register/index.twig"

At first, I noticed that the random folder that's specified as %o by the Poedit parser (e.g., poeditNoXV1p above) didn't exist. So I "hacked" twig-gettext-extractor and made it assert the existence of the path in the -o parameter. That "kinda" fixed it from the command line, but it still doesn't work from the poedit program.

Has anyone gotten this setup to work?

Saeven
  • 2,280
  • 1
  • 20
  • 33

3 Answers3

1

A bug in Poedit 1.5.7 (as you know by now). For other readers' reference:

Václav Slavík
  • 6,445
  • 2
  • 28
  • 25
0

Are you working on windows or *nix?

If you are working on *nix, make sure twig-gettext-extractor can find the php binary.

/usr/local/php54/bin/php /path/to/twig-gettext-extractor --sort-output ...etc

Replace /usr/local/php54/bin/php with the right path in your system.

Also make sure you have the right permissions to run/execute that file.

xmarcos
  • 3,298
  • 2
  • 20
  • 27
  • Thanks for chiming in! I'm working on OSX. Doesn't seem to be a problem with php from what I can tell, seems to be a permissions issue. At this point, I think it may be attributed to /var/folders being root-owned. Still digging. – Saeven Nov 06 '13 at 03:04
0

Finally built a GUI for ZF2, to replace PoEdit.

http://php-gettext-po-editor.com

Saeven
  • 2,280
  • 1
  • 20
  • 33
  • Rather than post [the same answer twice](http://stackoverflow.com/a/34682870/3155639), vote/flag to close as a duplicate, or if appropriate, make the answer question specific. – Alexander O'Mara Jan 08 '16 at 19:00