Translating symfony validator yaml configs with xgettext

Previously I wrote how to automate routine translation work with xgettext for symfony framework. Unfortunately xgettext cannot parse YAML configs. Obviously you’ll need to translate at least validator error messages. rgettext is not capable too.

I found some solution but I didn’t like it. I wanted to use PoEdit tool to have possibility for automated translation, syncing with sources and easy interface. So I wrote modified task which looks for all validation configs and creates fake php files with messages, which can be parsed by xgettext.

Usage is simple, just copy attached file to symfony/data/tasks in your PEAR directory and run symfony i18n-fake-php app_name. PHP files will be created in validate/ directories. After that you can use xgettext.


Sunday, March 9th, 2008