xgettext in OSX to create .po file from PHP code

FMaz008 picture FMaz008 · Dec 6, 2011 · Viewed 7.2k times · Source

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

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

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

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

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 ?

Answer

sorin picture sorin · Dec 6, 2011

Use brew to install it:

brew install gettext