Shane A. Stillwell
Poedit and phtml files giving error from xgettext

Poedit and phtml files giving error from xgettext

Hold on Cowboy

This blog post is pretty old. Be careful with the information you find in here. The Times They Are A-Changin'

Problem

I had just set up a Poedit for a project at work and was trying to update the *.po file with new translations. It wasn’t finding a whole load of them.

After a while of poking around, it dawned on me that it was not looking in my phtml files. Simple enough, I just added *.phtml to the list of extensions in the parsers preference.

Then I receive a big long error message that xgettext didn’t know what phtml.

Solution

Add pthtml to your list of extensions

*.php;*.phtml

You also need to add ” -L php” to the end of your Parser command

xgettext --force-po -o %o %C %K %F -L php`

Poedit Parse PHP `