I18n with gettext

The getgnulinux.org website was put for download as an archive containing static HTML pages. The HTML pages were automatically generated from source files and it would help if I had access to those source files, but unfortunately I don’t. Before I can start focusing on implementing the new translation system I need to get rid of those static HTML pages.

So I’ve started to convert all HTML pages to PHP pages. At the same time I was looking around for a translation solution;  that’s when I found GNU gettext. It turns out that PHP has support for GNU `gettext’. This means that translation files (*.po) can easily be extracted from the PHP pages. The translation files can then be translated with translation systems like Pootle or Launchpad Translate (not yet tested), and best of all, the same PHP pages can load the translation files of different languages (all using tools from the same `gettext’ package). I did some quick hacks to test this (I converted all pages to PHP with `gettext’ support), and it works like a charm!

I’ll be working hard on fully implementing `gettext’ support. This means that all English text strings in the PHP files need to be marked as translatable, and this is a lot of work.

One thought on “I18n with gettext”

Leave a Reply

Your email address will not be published. Required fields are marked *