l10n: More than one language
Posted by Sayamindu 1 year, 9 months ago
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.

This is a cool concept…
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.
jx2cgucpululrx9b