Skip to content
Advertisement

xgettext in OSX to create .po file from PHP code

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 ?

Advertisement

Answer

Use brew to install it:

brew install gettext

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement