Use gettext PO files for translation
Currently, it’s a bit difficult to translate the Web site, as you have to manually edit a PHP page, taking care to not damage any HTML or PHP markup.
It’s also difficult to keep the translations in sync when the English strings are changed. And any markup changes, even ones that don’t affect the actual translations, still have to be manually updated in all the translation files.
I therefore propose to change the translation system to the gettext PO format. This can be done using the ‘php2po’ tool.
In fact, this is how I did (and do) the Norwegian Nynorsk translation. I used php2po to create a POT file (translation template). I then copied this to a PO file, translated the file (using the user-friendly Lokalize application) and used po2php to convert the file back to a PHP file. Whenever the ‘en.php’ file is changed, I regenerate the POT file, merge the PO file, update the translation using Lokalize and regenerate the translation PHP file (everything except the actual translation is of course done by a script).
This currently works very well. But very long, multiparagraph strings with embedded markup (e.g., the PHILOSOPHY_BOTTOM
string) is a pain to translate, so if this is implemented, these strings should be split up (one string per paragraph or per sentence, and without any HTML markup, except where necessary (e.g. for inline tags like ‘’)).
I can probably do this, if you agree that it’s a good idea. (It’ll take some time, though.)