From: Nick H. <nic...@ho...> - 2009-12-30 18:43:11
|
Jerome, Thanks for the link. I need to read more about this. I added some code similar to this in commit 65. The Tip of the Day code reads an xml file which has multiple translations in it but ignores them. It then uses the usual _ function to translate the English text. I use the same technique but skipped the file conversion stage. I translate directly from the original xml file which I have not added the .in extension to. This may be confusing as it doesn't conform to an existing standard. Perhaps I should change this? The code should translate the xml file though. Regards, Nick. jerome wrote: > Nick, > > Thank you I will try under my locale. > At first glance, I noted that you also planned to allow translation on census.xml. > > Current make.py ignores this translation strings, we need to add something like this : > > system('''intltool-extract --type=gettext/xml "%(addon)s"/*.xml.in''') > system('''intltool-extract --type=gettext/glade "%(addon)s"/*.glade''') > system('''xgettext --language=Python --keyword=_ --keyword=N_''' > ''' -o "%(addon)s/po/template.pot" "%(addon)s"/*.py ''') > system('''xgettext -j --keyword=_ --keyword=N_''' > ''' -o "%(addon)s/po/template.pot" ''' > '''"%(addon)s"/*.glade.h''') > system('''xgettext -j --keyword=_ --keyword=N_''' > ''' -o "%(addon)s/po/template.pot" ''' > '''"%(addon)s"/*.xml.in.h''') > ... > > then we have the choice ! > > 1. retrieve translations and generate census.xml > intltool-merge -x po/ census.xml.in census.xml > > 2. retrieve translations and generate multiple localized census.xml > intltool-merge -x -m po/ census.xml.in census.xml > > http://www.gnome.org/~malcolm/i18n/marking-strings.html#xml > > > Regards, > > Jérôme. > > |