>>> from awn.extras import defsThis way all the translations are/will be in a single place, and translating will be much easier. To-do now supports translations, and mail will be able to when the new template is imported. The template is created by using 'xgettext'. This is what I ran to get the template:
>>> defs.PREFIX
'/usr/local/'
>>> defs.GETTEXTDIR
'/usr/local/share/locale'
xgettext src/*/*.py src/*/*.c --keyword=_ -o po/messages.pot --from-code=utf-8This is the necessary Python code for making an applet translatable:
import gettextPass every translatable string to the '_' function. Make sure to put all the text in one long line, as in don't use multiple strings combined by '+'. If you need to use variables, use '%s', etc. This is necessary for xgettext to recognize the string.
import locale
from awn.extras import defs
APP = "awn-extras-applets"
gettext.bindtextdomain(APP, defs.GETTEXTDIR)
gettext.textdomain(APP)
_ = gettext.gettext
I imagine it's mostly the same in C. Some of the applets already have the translation code. When the translations are downloaded from Launchpad, the .po files go in the po folder, the ISO codes are added to the LINGUAS file in po and the ALL_LINGUAS variable in configure.ac. I did some testing with To-do in Spanish, and it works.
Awn Extras Translations
P.S.: If you haven't tried out 0.3.2, what are you waiting for?
Update: The template has been imported!