l10n: More than one language

Falling back to English when translation of a particular string is not found is not always the best solution. As a practical example, our Aymara users would prefer that the fallback language be Spanish, and only if the Spanish translation is not found, English should be shown.

I was wondering how to implement this for Sugar and its activities, and I realized that something like this is already implemented in Python’s gettext implementation. So after some changes to Sugar, I had the following:

In the screenshot, the Restart Game pop-up is not translated into Aymara, and so it shows up in Spanish as Reiniciar Juego, while the rest of the strings are in Aymara.

Of course, there is a lot more to be done – the Sugar control panel language selector needs to be changed to allow selection and ordering of multiple languages, and currently this works for activities, core Sugar needs to support this feature as well.

Commentary

Leave a response »

  1. 1. 1 year, 9 months ago

    This is a cool concept…

  2. 2. 1 year, 9 months ago

    This is implemented in GNU gettext as well, so it will work for pretty much any free software out there. From the gettext(3) manual page:

    If the LANGUAGE environment variable is set to a nonempty value, and the locale is not the “C” locale, the value of LANGUAGE is assumed to contain a colon separated list of locale names. The functions will attempt to look up a translation of msgid in each of the locales in turn.

    So all you need to do is to configure your LANGUAGE environment according to your needs.

    Sven Neumann
  3. 3. 1 year, 8 months ago

    jx2cgucpululrx9b

    Tabitha Moon

Trackbacks

Leave a comment, a trackback from your own site or subscribe to an RSS feed for this entry. Trackback URL for this entry Comments feed for this entry

Leave a response

Leave a URL

Preview