使用Poedit解析Zend Framework 2应用程序中的Twig模板 [英] Using Poedit to parse Twig templates in a Zend Framework 2 application

查看:77
本文介绍了使用Poedit解析Zend Framework 2应用程序中的Twig模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经下载了Poedit,并试图解析我的Twig模板.在线一些教程指向 https://github.com/umpirsky/Twig-Gettext-Extractor我后来发现的 http://aromatix.fr/?p=611(法语)并附有完整说明.

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.

我完成了教程,安装了umpirsky/twig-gettext-extractor,当它尝试构建目录时,它死于无法执行程序".错误弹出窗口包含以下命令:

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"

起初,我注意到由Poedit解析器指定为%o的随机文件夹(例如,上面的poeditNoXV1p)不存在.因此,我入侵"了twig-gettext-extractor,并使其在-o参数中断言路径的存在.该"kinda"是从命令行修复的,但在poedit程序中仍然无法使用.

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.

有人能使用此设置吗?

推荐答案

最后为ZF2构建了一个GUI,以替换PoEdit.

Finally built a GUI for ZF2, to replace PoEdit.

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

这篇关于使用Poedit解析Zend Framework 2应用程序中的Twig模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆