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?

4

3 回答 3

1

Poedit 1.5.7 中的一个错误(如你所知)。供其他读者参考:

于 2013-11-06T05:37:41.453 回答
0

你是在 windows 还是 *nix 上工作?

如果您正在使用 *nix,请确保twig-gettext-extractor可以找到 php binary

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

替换/usr/local/php54/bin/php为系统中的正确路径。

还要确保您具有运行/执行该文件的正确权限。

于 2013-11-06T02:41:58.923 回答
0

最后为 ZF2 构建了一个 GUI,以取代 PoEdit。

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

于 2016-01-08T17:39:18.457 回答