mercredi 26 mai 2010

All your language are belong to mini18n

Mini18n is a tiny i18n library that was original designed to handle translations in Yabause and that is now available on some Linux distribution (well... at least Debian and Ubuntu) as a dependency of the emulator.

When I started working on translation support for Yabause, the obvious solution, as a Linux user, would have been to use gettext. But this solution had a number of shortcomings:

  • gettext is painful to include/maintain in a project: we're using it to translate the glade port of DeSmuME and I still don't understand how it works and/or how to fix it when it
    breaks;

  • we needed a portable solution, something that could be easily built on different platforms Yabause supports;

  • we also wanted to be able to staticaly link it into Yabause binary, so we didn't had to ship some extra DLL.

(btw... I can be wrong on some/all of these points, I'm not a gettext expert)

So I ended up writing a small translation library and make it live in the Yabause CVS, so every Yabause developer could fix it, if he needed to.

This was two years ago, and not much changed since that time: CVS is now a SVN ; Gtk+, Qt and Windows ports of Yabause can use mini18n for their translations ; I also started to work on gettext format support for mini18n but didn't finished it; all in all, there wasn't much interest in the library until recently.

Some friend asked me if mini18n could be updated to include multiple language support... at once. He's working on some server software and thought about using mini18n to translate
strings sent to the client. Problem is if you got some french, german and italian users at once, you only have two choices: fork a process for each different language or load those three languages in the same process with a multi-language library.

After taking a quick look at mini18n codebase (yeah... it was a while I didn't worked on it...), I realized it wouldn't be hard to add the feature. On the other hand, the project sounded quite fun and would double the number of programs using mini18n! In fact, the change took me longer than I expected, mostly because I wanted to keep old single-language interface intact and also the two interfaces to play nicely with each other. So, mini18n has now a new API and the old API was rewrote on top on the new one. There shouldn't be problems for a program to use both APIs at the same time.

Next step will be to make sure I didn't broke ABI compatibilty with previous release and if that's ok, we may see another mini18n release soon!

3 commentaires:

  1. googlebuzz:1: instanciated from here
    post:1: warning: this post is not about music !!
    :)

    RépondreSupprimer
  2. yeah :)
    next post should be about music...

    RépondreSupprimer
  3. And mini18n fits in great with that server software that I'm working on. Now if only I could convince myself to work on finishing up the multi-language support in it, I'd be all set. ;)

    Thanks again. :)

    RépondreSupprimer