July 20, 2010

translation options

Tags: , , , , , , , ,
Filed under: ZenMagick — DerManoMann @ 3:41 am

I’ve finally finished the reorganization of the language/translation code. Yay!

So, what does that mean, you ask? Fair questions:

  • ZenMagick now can support the same locale file structure that gettext requires. It is not mandatory, though.
  • Translation strings can be stored in either .yaml or .mo (compatible with gettext) files.
  • Translations may be split into many files. However, in that case it is your problem to load those. The default behaviour is to load just a single translation map.

That means you can use the homegrown system just like before (with the only change that translations are not store in PHP code anymore, but as YAML hash map).

The code to handle .mo files is named pomo and is used in glotpress and also Wordpress. So far it has lived a quit live as plugin in ZenMagick, but today it moved into core for all to see and enjoy.

I haven’t decided what to do about the new admin UI. Right now the priority is to get it going at all. Once that is sorted it might really become an option to use a place like transifex to mange translations. In that case pomo would come in very handy, indeed.

February 22, 2010

locale changes

Tags: , ,
Filed under: ZenMagick — DerManoMann @ 4:19 am

I’ve started working on the locale code again, in particular i18n. Also, I’ll have a serious go at adding support for gettext via pomo (also used in Wordpress). It’s a bit tricky and will probably require changing everything at the same time, so this might not make it into the very next release.

Also, since the date handling in ZenMagick is currently somewhat esoteric, to say the least, I’ll be looking into using the newish (>=PHP5.2.0) datetime features. Should there be any know issues, obviously I’d love to hear about those…

For gettext I also ponder renaming the current zm_l10n functions to something like _zm and __zm – some people really dig short function names (and some are justĀ  lazy).

Comments welcome.