在OSX中使用xgettext从PHP代码创建.po文件 [英] xgettext in OSX to create .po file from PHP code

查看:89
本文介绍了在OSX中使用xgettext从PHP代码创建.po文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Mac OSX,无法找到一种很好的解决方案来解析PHP代码并提取可翻译字符串.

I'm on Mac OSX, and I'm unable to find a good solution to parse PHP Code and extract the translatable strings.

我已经尝试过PoEdit,但是它失败了,并出现了反冗长的中继错误:

I've tried PoEdit, but it fail with an anti-verbose trunkated error:

我也尝试过Virtaal,但是当我单击打开"时,应用程序崩溃,这是浏览窗口出现之前的事件.

I've also tried Virtaal, but the app crash when I click "Open", event before the browsing windows appear.

我已经尝试过OmegaT,但是我认为它不支持.po文件.我不知道它是如何工作的:(

I've tried OmegaT, but I think it doesn't support .po files. I can't figure out how it works :(

我也尝试过xgettext.pl,它工作得很好,除了它没有检测到PHP dgettext()函数,而且似乎没有像poEdit那样提供任何额外的选项来配置额外的关键字.手册页在这里: http://www.unix.com/手册页/OSX/1/xgettext.pl/

I've also tried xgettext.pl, and it work really well, except it doesn't detect the PHP dgettext() function, and doesn't seem to offer any additional option to configure extra keyword like poEdit does. Man page is here: http://www.unix.com/man-page/OSX/1/xgettext.pl/

到目前为止有什么解决方案吗?

Any solution so far ?

推荐答案

使用 brew 安装它:

Use brew to install it:

brew install gettext

这篇关于在OSX中使用xgettext从PHP代码创建.po文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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