From: Nick H. <nic...@ho...> - 2009-12-30 22:10:20
|
Jerome, The xml is in English only. The elements that need translating begin with underscores. The make.py script adds the translatable text to the po file. This allows the strings to be translated and added to the translation catalogue. When I read the xml, I read in the text in English and use the usual _() function to translate it. In this way I don't ever need the translated text in an xml file. We may want to change this approach though, if there is a more standard way of doing things. It is worth noting that although the Tip of the Day xml file is translated, only the English text is actually read, and the elements containing translated text are ignored. Regards, Nick. jerome wrote: > Nick, > > Maybe I made a mistake ... :-[ > "I translate directly from the original xml" means you directly translate into the xml ? You do not translate strings into po file ? Isn't it ? > > >> I'll email you the fr-local.po file I used for testing - it >> probably isn't a good translation though. >> > > I did not have gramps-addons (no Gramps on this PC ...), so I did not test Census translation yet ! Planned on next days. > > > Thank you ! > > Jérôme > > --- En date de : Mer 30.12.09, Nick Hall <nic...@ho...> a écrit : > > >> De: Nick Hall <nic...@ho...> >> Objet: Re: [Gramps-devel] Re : Census entry and Certificates in the Ecosystem definition >> À: "jerome" <rom...@ya...> >> Cc: "Gramps developers" <gra...@li...> >> Date: Mercredi 30 Décembre 2009, 20h48 >> Jerome, >> >> It all gets translated for me. >> >> When I ran the clean and init the entries appeared in the >> po file for translation. >> >> "Where Born" does mean Birthplace. >> >> I'll email you the fr-local.po file I used for testing - it >> probably isn't a good translation though. >> >> Nick. >> >> jerome wrote: >> >>> Nick, >>> >>> >>> >>>> I translate directly from the original xml >>>> >> file >> >>> Maybe only strings which was already translated (Name, >>> >> Place, Census, etc ...) are localized. Translation file is >> just a big dictionary with keys/values. So once entry is >> translated, strings can be re-used. Maybe that's why some >> distributions want to centralize all translations >> (consistency and to avoid duplicated work) ! >> >>> Note, gramps-connect and gramps working together, also >>> >> means re-use of translation strings[1] ... strings label >> should not be so far away ;) >> >>> On census.xml, entries like : >>> City or Borough >>> Parish or Township >>> Where Born >>> Ecclesiastical District >>> City or Borough >>> ... >>> cannot be translated because there are not on the >>> >> translation template. (and will be ignored on translation) >> >>> http://gramps-addons.svn.sourceforge.net/viewvc/gramps-addons/contrib/Census/census.xml?view=markup >>> >>> There is also strings translated 'out of gramps' : >>> >> some common Gtk+ labels (ex: on buttons) >> >>> PS: what does "Where Born" mean ? >>> "place of birth" or it is a "mark/comment on census" >>> >> ? >> >>> Regards, >>> Jérôme >>> >>> [1] http://www.gramps-project.org/bugs/view.php?id=3417 >>> >>> >>> --- En date de : Mer 30.12.09, Nick Hall <nic...@ho...> >>> >> a écrit : >> >>> >>> >>>> De: Nick Hall <nic...@ho...> >>>> Objet: Re: [Gramps-devel] Re : Census entry and >>>> >> Certificates in the Ecosystem definition >> >>>> À: "jerome" <rom...@ya...> >>>> Cc: "Gramps developers" <gra...@li...> >>>> Date: Mercredi 30 Décembre 2009, 19h42 >>>> 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. >>>>> >>>>> >>>>> >>> >>> >>> >>> >>> > > > > > > |