From: jerome <rom...@ya...> - 2012-10-02 13:42:27
|
> "Alternatively, I could keep the Makefiles for po generation." It seems that current translation environment (POTFILES.in POTFILE.skip, Makefile.am) is related to configure.in! Inherited from Gnome... http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#How_it_works http://people.gnome.org/~malcolm/i18n/makefile-changes.html An illustration could be the "unittest for testing POTFILES.in and Makefile contents": http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/po/test/po_test.py 'configure/Makefile' are related, and to only provide Makefile for po generation will maybe mean to keep 'configure/makefile' framework for all gramps' modules! Note, the 'po/test/po_test.py' script was for testing missing references into Makefile.am or POTFILES.in and POTFILE.skip. To keep Makefiles mean to still deal with these possible missing references!!! Jérôme --- En date de : Mar 2.10.12, Benny Malengier <ben...@gm...> a écrit : De: Benny Malengier <ben...@gm...> Objet: Re: Re : po À: "jerome" <rom...@ya...> Cc: "Gramps Development List" <gra...@li...> Date: Mardi 2 octobre 2012, 10h28 Alternatively, I could keep the Makefiles for po generation. People installing Gramps don't need to run make, but you would have to do it in the po directory. Benny 2012/10/2 jerome <rom...@ya...> Benny, It is still experimental for handling po files and gramps.pot with python libs and GNU tools only. In fact, it was tested with python 2.6 some months ago... One thing is remaining for a complete support with python 2.7: one "function/set of lines" is still working with python 2.6 only. Something like: from xml.etree import ElementTree tree = ElementTree.parse(filename) root = tree.getroot() mark = _tip for key in root.getiterator(mark): I tested an other way, which seems to be more correct, something like: for key in root.iter(): if key.attrib.get(mark): ... To spare one line does not really makes sense if this does not work after a python update/migration... I suppose it could be one common function for both files who really need to be parsed: 'holidays.xml' and 'tips.xml'. Note, 'optparse' is also a deprecated module under python 2.7 (migration)... http://docs.python.org/library/optparse.html I know that it should rather use 'argparse' with this python version. http://docs.python.org/library/argparse.html#module-argparse > Second, if you test on python version, don't check on the 7, but use instead > or <. Currently, it should still work with python 2.6 and there is a partial support with python 2.7. About python 3.x, I do not think this will work! Yes, the next step will be to support python 2.7 and +. If so, do not need to test for python 2.6 anymore. Note, about translation and 'src->gramps' migration, one module usage is not clear, but I guess it will be modified on next revisions: 'const.py.in'. It is cosmetic. ie. to change 'const.py.in' reference by 'const.py'. Else, 'update_po' has grouped all commands/steps for translation/template handling by using python. John and Rob did not think that getting rid of 'intltool' was useful. If Gramps provides a more 'python-standard' way for installation, I suppose to have a python script for translations might be also useful. It could be also used under others pateforms with few efforts. Thank you for advices about coding. Jérôme --- En date de : Lun 1.10.12, Benny Malengier <ben...@gm...> a écrit : De: Benny Malengier <ben...@gm...> Objet: po À: "Jérôme" <rom...@ya...> Cc: "Gramps Development List" <gra...@li...> Date: Lundi 1 octobre 2012, 19h30 Jerome, I see you changed update_po. Some things. First, trunk requires python 2.7, so it is not needed to do python 2.6 workarounds. Second, if you test on python version, don't check on the 7, but use instead > or <. Benny |
From: jerome <rom...@ya...> - 2012-10-03 11:03:57
|
> "I removed make and friends now." Oh, so fast! Note, 'update_po' is a mix between 'get_strings' (Gramps 2.0) logic, the way used by Gnome (intltool, POTFILES), Stephen George (Windows port) and Kees Bakker's (check_po)! Currently, only few translators have generated the template for translations via make. On trunk, we just need to check if something is not wrong or missing for a complete 'gramps.pot'. The others flags are just set of commands often used by translators. > "1/add some documentation at top of update_po on how it should be used. To me it is not clear at the moment :-)" python po/update_po.py -h or python po/update_po.py --help You are right maybe because I generated and tested this file, I was aware of existing flags ... :( > "2/update the translation documentation on the wiki, so we have an old page which is for gramps 3.x and before, and a current page on how to do things with gramps 4." Yes, I will do. :) > "update_po seems to run here with python2.7" Maybe when a function is 'deprecated', there is a transition period? ie. still work with 2.7, but will be removed soon? http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator The problem could occur when we try to retrieve strings from tips.xml.in with python 2.7 and the iteration function: a naming issue (and generator) between python 2.6 and python 2.7 ... :( Note, about the output, there is some minor issues: 1. tips.xml.in has some special cases (not consistent by parsing). During testing it was tips 7 and 18! EOL or something like that, because the quick parser for getting these strings need special cases: tip = tip.replace("\n</_tip>\n", "</_tip>\n") # special case tip 7 tip = tip.replace("\n<b>", "<b>") # special case tip 18 2. some translation strings might be improved according python mapping! Just run 'update_po -p' for generating a new template and you will see some warnings. It was planned to improve current code. The classical _('%s is %s with %s for %s under %s at %s') What are these variables/values??? How to order them??? http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#Use_named_.25s_values 3. check flag ("-k", "--check") will not properly work for locale with more than two characters (pt_BR, zh_CN)... 4. generated 'gramps.pot' will ignore strings from 'const.py.in'. A reference issue, which is set under 'gramps' file (plain text file). 5. What should be done with: /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys? I guess they were unchanged since many years, but currently they are always parsed (gramps.pot) and regenerated every time during build time (under Linux, BSD, etc ...MacOS?)! All cosmetic issues. Jérôme --- En date de : Mer 3.10.12, Benny Malengier <ben...@gm...> a écrit : De: Benny Malengier <ben...@gm...> Objet: Re: Re : po À: "jerome" <rom...@ya...> Cc: "Gramps Development List" <gra...@li...> Date: Mercredi 3 octobre 2012, 11h34 Jerome, I removed make and friends now. update_po seems to run here with python2.7. If you need help with something, just let me know. It would be great if you: 1/add some documentation at top of update_po on how it should be used. To me it is not clear at the moment :-) 2/update the translation documentation on the wiki, so we have an old page which is for gramps 3.x and before, and a current page on how to do things with gramps 4.9 Benny 2012/10/2 jerome <rom...@ya...> Benny, It is still experimental for handling po files and gramps.pot with python libs and GNU tools only. In fact, it was tested with python 2.6 some months ago... One thing is remaining for a complete support with python 2.7: one "function/set of lines" is still working with python 2.6 only. Something like: from xml.etree import ElementTree tree = ElementTree.parse(filename) root = tree.getroot() mark = _tip for key in root.getiterator(mark): I tested an other way, which seems to be more correct, something like: for key in root.iter(): if key.attrib.get(mark): ... To spare one line does not really makes sense if this does not work after a python update/migration... I suppose it could be one common function for both files who really need to be parsed: 'holidays.xml' and 'tips.xml'. Note, 'optparse' is also a deprecated module under python 2.7 (migration)... http://docs.python.org/library/optparse.html I know that it should rather use 'argparse' with this python version. http://docs.python.org/library/argparse.html#module-argparse > Second, if you test on python version, don't check on the 7, but use instead > or <. Currently, it should still work with python 2.6 and there is a partial support with python 2.7. About python 3.x, I do not think this will work! Yes, the next step will be to support python 2.7 and +. If so, do not need to test for python 2.6 anymore. Note, about translation and 'src->gramps' migration, one module usage is not clear, but I guess it will be modified on next revisions: 'const.py.in'. It is cosmetic. ie. to change 'const.py.in' reference by 'const.py'. Else, 'update_po' has grouped all commands/steps for translation/template handling by using python. John and Rob did not think that getting rid of 'intltool' was useful. If Gramps provides a more 'python-standard' way for installation, I suppose to have a python script for translations might be also useful. It could be also used under others pateforms with few efforts. Thank you for advices about coding. Jérôme --- En date de : Lun 1.10.12, Benny Malengier <ben...@gm...> a écrit : De: Benny Malengier <ben...@gm...> Objet: po À: "Jérôme" <rom...@ya...> Cc: "Gramps Development List" <gra...@li...> Date: Lundi 1 octobre 2012, 19h30 Jerome, I see you changed update_po. Some things. First, trunk requires python 2.7, so it is not needed to do python 2.6 workarounds. Second, if you test on python version, don't check on the 7, but use instead > or <. Benny |
From: Benny M. <ben...@gm...> - 2012-10-03 12:25:34
|
Ok, I don't follow everything you wrote :-) I updated update_po.py, now py.in files are present in gramps.pot also. Please test. So that is fixed. All works for python 2.7 now. Optionparser is deprecated, but not difficult to change to the new system, we can do that another time. About documentation, I meant something in the lines of how to use update_po to be up to date for translation or release. The help only explains the options. I don't see the problems in tips, you will have to be more specific if there is something I should look at. The warnings you mention (I suppose you mean the output "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string with unnamed arguments cannot be properly localized:" are things in the translation you can fix I also fixed a bit for pt_BR output on check, not sure if that is the problem you meant. Lastly, "5. What should be done with: /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" I don't follow, is there a problem there? intltool-extract is used for these, will this stop working? Benny 2012/10/3 jerome <rom...@ya...> > > "I removed make and friends now." > > Oh, so fast! > > Note, 'update_po' is a mix between 'get_strings' (Gramps 2.0) logic, the > way used by Gnome (intltool, POTFILES), Stephen George (Windows port) and > Kees Bakker's (check_po)! > > Currently, only few translators have generated the template for > translations via make. On trunk, we just need to check if something is not > wrong or missing for a complete 'gramps.pot'. > > The others flags are just set of commands often used by translators. > > > "1/add some documentation at top of update_po on how it should be used. > To me it is not clear at the moment :-)" > > python po/update_po.py -h > or > python po/update_po.py --help > > You are right maybe because I generated and tested this file, I was aware > of existing flags ... :( > > > "2/update the translation documentation on the wiki, so we have an old > page which is for gramps 3.x and before, and a current page on how to do > things with gramps 4." > > Yes, I will do. :) > > > "update_po seems to run here with python2.7" > > Maybe when a function is 'deprecated', there is a transition period? > ie. still work with 2.7, but will be removed soon? > > > http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator > > The problem could occur when we try to retrieve strings from tips.xml.inwith python 2.7 and the iteration function: a naming issue (and generator) > between python 2.6 and python 2.7 ... :( > > > Note, about the output, there is some minor issues: > > 1. tips.xml.in has some special cases (not consistent by parsing). > During testing it was tips 7 and 18! > > EOL or something like that, because the quick parser for getting these > strings need special cases: > > tip = tip.replace("\n</_tip>\n", "</_tip>\n") # special case tip 7 > tip = tip.replace("\n<b>", "<b>") # special case tip 18 > > 2. some translation strings might be improved according python mapping! > Just run 'update_po -p' for generating a new template and you will see > some warnings. It was planned to improve current code. > > The classical _('%s is %s with %s for %s under %s at %s') > > What are these variables/values??? > How to order them??? > > > http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#Use_named_.25s_values > > 3. check flag ("-k", "--check") will not properly work for locale with > more than two characters (pt_BR, zh_CN)... > > 4. generated 'gramps.pot' will ignore strings from 'const.py.in'. > A reference issue, which is set under 'gramps' file (plain text file). > > 5. What should be done with: > /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys? > I guess they were unchanged since many years, but currently they are > always parsed (gramps.pot) and regenerated every time during build time > (under Linux, BSD, etc ...MacOS?)! > > All cosmetic issues. > > > Jérôme > > > --- En date de : Mer 3.10.12, Benny Malengier <ben...@gm...> > a écrit : > > De: Benny Malengier <ben...@gm...> > Objet: Re: Re : po > À: "jerome" <rom...@ya...> > Cc: "Gramps Development List" <gra...@li...> > Date: Mercredi 3 octobre 2012, 11h34 > > Jerome, > > I removed make and friends now. > update_po seems to run here with python2.7. > > If you need help with something, just let me know. > It would be great if you: > > 1/add some documentation at top of update_po on how it should be used. To > me it is not clear at the moment :-) > > > 2/update the translation documentation on the wiki, so we have an old page > which is for gramps 3.x and before, and a current page on how to do things > with gramps 4.9 > > Benny > 2012/10/2 jerome <rom...@ya...> > > Benny, > > > > It is still experimental for handling po files and gramps.pot with python > libs and GNU tools only. > > > > In fact, it was tested with python 2.6 some months ago... > > One thing is remaining for a complete support with python 2.7: one > "function/set of lines" is still working with python 2.6 only. > > > > Something like: > > > > from xml.etree import ElementTree > > > > tree = ElementTree.parse(filename) > > root = tree.getroot() > > > > mark = _tip > > > > for key in root.getiterator(mark): > > > > I tested an other way, which seems to be more correct, something like: > > > > for key in root.iter(): > > if key.attrib.get(mark): > > ... > > > > To spare one line does not really makes sense if this does not work after > a python update/migration... I suppose it could be one common function for > both files who really need to be parsed: 'holidays.xml' and 'tips.xml'. > > > > > Note, 'optparse' is also a deprecated module under python 2.7 > (migration)... http://docs.python.org/library/optparse.html > > I know that it should rather use 'argparse' with this python version. > > http://docs.python.org/library/argparse.html#module-argparse > > > > > Second, if you test on python version, don't check on the 7, but use > instead > or <. > > > > Currently, it should still work with python 2.6 and there is a partial > support with python 2.7. About python 3.x, I do not think this will work! > > > > Yes, the next step will be to support python 2.7 and +. > > If so, do not need to test for python 2.6 anymore. > > > > Note, about translation and 'src->gramps' migration, one module usage is > not clear, but I guess it will be modified on next revisions: 'const.py.in'. > It is cosmetic. ie. to change 'const.py.in' reference by 'const.py'. > Else, 'update_po' has grouped all commands/steps for translation/template > handling by using python. > > > > > John and Rob did not think that getting rid of 'intltool' was useful. > > If Gramps provides a more 'python-standard' way for installation, I > suppose to have a python script for translations might be also useful. > > It could be also used under others pateforms with few efforts. > > > > > > Thank you for advices about coding. > > > > Jérôme > > > > --- En date de : Lun 1.10.12, Benny Malengier <ben...@gm...> > a écrit : > > > > De: Benny Malengier <ben...@gm...> > > Objet: po > > À: "Jérôme" <rom...@ya...> > > Cc: "Gramps Development List" <gra...@li...> > > Date: Lundi 1 octobre 2012, 19h30 > > > > Jerome, > > > > I see you changed update_po. Some things. > > First, trunk requires python 2.7, so it is not needed to do python 2.6 > workarounds. > > Second, if you test on python version, don't check on the 7, but use > instead > or <. > > > > > > Benny > > > > > > > > > |
From: Jérôme <rom...@ya...> - 2012-10-04 18:27:00
Attachments:
update_po.patch
|
As attachement a patch which gets rid of intltool for extracting these strings (pure python). Sure, it could be polished... I quickly generated it for working as expected, but I suppose I do not used the best methods! What do you think? Any advices for a better code? Jérôme Le 03/10/2012 14:25, Benny Malengier a écrit : > > Lastly, "5. What should be done with: > /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" > I don't follow, is there a problem there? intltool-extract is used for > these, will this stop working? > > Benny |
From: Benny M. <ben...@gm...> - 2012-10-03 12:34:48
|
One more thing. I don't like the name gramps for the list of files. Can we use POTFILES.in again? We can remove POTFILES.skip I suppose and that gramps file then. It sufficies there to svn skip empty lines or lines starting with #, which is the case in latest rev 20502. So if you could move back to POTFILES.in with the nice in directories divided structure? Guideline would then again be: for code that must be translated: update POTFILES.in Benny 2012/10/3 Benny Malengier <ben...@gm...> > Ok, > > I don't follow everything you wrote :-) > > I updated update_po.py, now py.in files are present in gramps.pot also. > Please test. > So that is fixed. All works for python 2.7 now. Optionparser is > deprecated, but not difficult to change to the new system, we can do that > another time. > > About documentation, I meant something in the lines of how to use > update_po to be up to date for translation or release. The help only > explains the options. > > I don't see the problems in tips, you will have to be more specific if > there is something I should look at. > > The warnings you mention (I suppose you mean the output > "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string > with unnamed arguments cannot be properly localized:" > are things in the translation you can fix > > I also fixed a bit for pt_BR output on check, not sure if that is the > problem you meant. > > Lastly, "5. What should be done with: > /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" > I don't follow, is there a problem there? intltool-extract is used for > these, will this stop working? > > Benny > > > 2012/10/3 jerome <rom...@ya...> > >> > "I removed make and friends now." >> >> Oh, so fast! >> >> Note, 'update_po' is a mix between 'get_strings' (Gramps 2.0) logic, the >> way used by Gnome (intltool, POTFILES), Stephen George (Windows port) and >> Kees Bakker's (check_po)! >> >> Currently, only few translators have generated the template for >> translations via make. On trunk, we just need to check if something is not >> wrong or missing for a complete 'gramps.pot'. >> >> The others flags are just set of commands often used by translators. >> >> > "1/add some documentation at top of update_po on how it should be used. >> To me it is not clear at the moment :-)" >> >> python po/update_po.py -h >> or >> python po/update_po.py --help >> >> You are right maybe because I generated and tested this file, I was aware >> of existing flags ... :( >> >> > "2/update the translation documentation on the wiki, so we have an old >> page which is for gramps 3.x and before, and a current page on how to do >> things with gramps 4." >> >> Yes, I will do. :) >> >> > "update_po seems to run here with python2.7" >> >> Maybe when a function is 'deprecated', there is a transition period? >> ie. still work with 2.7, but will be removed soon? >> >> >> http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator >> >> The problem could occur when we try to retrieve strings from tips.xml.inwith python 2.7 and the iteration function: a naming issue (and generator) >> between python 2.6 and python 2.7 ... :( >> >> >> Note, about the output, there is some minor issues: >> >> 1. tips.xml.in has some special cases (not consistent by parsing). >> During testing it was tips 7 and 18! >> >> EOL or something like that, because the quick parser for getting these >> strings need special cases: >> >> tip = tip.replace("\n</_tip>\n", "</_tip>\n") # special case tip 7 >> tip = tip.replace("\n<b>", "<b>") # special case tip 18 >> >> 2. some translation strings might be improved according python mapping! >> Just run 'update_po -p' for generating a new template and you will see >> some warnings. It was planned to improve current code. >> >> The classical _('%s is %s with %s for %s under %s at %s') >> >> What are these variables/values??? >> How to order them??? >> >> >> http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#Use_named_.25s_values >> >> 3. check flag ("-k", "--check") will not properly work for locale with >> more than two characters (pt_BR, zh_CN)... >> >> 4. generated 'gramps.pot' will ignore strings from 'const.py.in'. >> A reference issue, which is set under 'gramps' file (plain text file). >> >> 5. What should be done with: >> /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys? >> I guess they were unchanged since many years, but currently they are >> always parsed (gramps.pot) and regenerated every time during build time >> (under Linux, BSD, etc ...MacOS?)! >> >> All cosmetic issues. >> >> >> Jérôme >> >> >> --- En date de : Mer 3.10.12, Benny Malengier <ben...@gm...> >> a écrit : >> >> De: Benny Malengier <ben...@gm...> >> Objet: Re: Re : po >> À: "jerome" <rom...@ya...> >> Cc: "Gramps Development List" <gra...@li...> >> Date: Mercredi 3 octobre 2012, 11h34 >> >> Jerome, >> >> I removed make and friends now. >> update_po seems to run here with python2.7. >> >> If you need help with something, just let me know. >> It would be great if you: >> >> 1/add some documentation at top of update_po on how it should be used. To >> me it is not clear at the moment :-) >> >> >> 2/update the translation documentation on the wiki, so we have an old >> page which is for gramps 3.x and before, and a current page on how to do >> things with gramps 4.9 >> >> Benny >> 2012/10/2 jerome <rom...@ya...> >> >> Benny, >> >> >> >> It is still experimental for handling po files and gramps.pot with python >> libs and GNU tools only. >> >> >> >> In fact, it was tested with python 2.6 some months ago... >> >> One thing is remaining for a complete support with python 2.7: one >> "function/set of lines" is still working with python 2.6 only. >> >> >> >> Something like: >> >> >> >> from xml.etree import ElementTree >> >> >> >> tree = ElementTree.parse(filename) >> >> root = tree.getroot() >> >> >> >> mark = _tip >> >> >> >> for key in root.getiterator(mark): >> >> >> >> I tested an other way, which seems to be more correct, something like: >> >> >> >> for key in root.iter(): >> >> if key.attrib.get(mark): >> >> ... >> >> >> >> To spare one line does not really makes sense if this does not work after >> a python update/migration... I suppose it could be one common function for >> both files who really need to be parsed: 'holidays.xml' and 'tips.xml'. >> >> >> >> >> Note, 'optparse' is also a deprecated module under python 2.7 >> (migration)... http://docs.python.org/library/optparse.html >> >> I know that it should rather use 'argparse' with this python version. >> >> http://docs.python.org/library/argparse.html#module-argparse >> >> >> >> > Second, if you test on python version, don't check on the 7, but use >> instead > or <. >> >> >> >> Currently, it should still work with python 2.6 and there is a partial >> support with python 2.7. About python 3.x, I do not think this will work! >> >> >> >> Yes, the next step will be to support python 2.7 and +. >> >> If so, do not need to test for python 2.6 anymore. >> >> >> >> Note, about translation and 'src->gramps' migration, one module usage is >> not clear, but I guess it will be modified on next revisions: ' >> const.py.in'. It is cosmetic. ie. to change 'const.py.in' reference by >> 'const.py'. Else, 'update_po' has grouped all commands/steps for >> translation/template handling by using python. >> >> >> >> >> John and Rob did not think that getting rid of 'intltool' was useful. >> >> If Gramps provides a more 'python-standard' way for installation, I >> suppose to have a python script for translations might be also useful. >> >> It could be also used under others pateforms with few efforts. >> >> >> >> >> >> Thank you for advices about coding. >> >> >> >> Jérôme >> >> >> >> --- En date de : Lun 1.10.12, Benny Malengier <ben...@gm...> >> a écrit : >> >> >> >> De: Benny Malengier <ben...@gm...> >> >> Objet: po >> >> À: "Jérôme" <rom...@ya...> >> >> Cc: "Gramps Development List" <gra...@li...> >> >> Date: Lundi 1 octobre 2012, 19h30 >> >> >> >> Jerome, >> >> >> >> I see you changed update_po. Some things. >> >> First, trunk requires python 2.7, so it is not needed to do python 2.6 >> workarounds. >> >> Second, if you test on python version, don't check on the 7, but use >> instead > or <. >> >> >> >> >> >> Benny >> >> >> >> >> >> >> >> >> > |
From: Benny M. <ben...@gm...> - 2012-10-03 15:12:04
|
2012/10/3 Benny Malengier <ben...@gm...> > One more thing. > I don't like the name gramps for the list of files. Can we use POTFILES.in > again? > We can remove POTFILES.skip I suppose and that gramps file then. > I changed my mind. I would like to have it automatic, and only blacklist things. I'll quickly try that. Benny > > It sufficies there to svn skip empty lines or lines starting with #, which > is the case in > latest rev 20502. > > So if you could move back to POTFILES.in with the nice in directories > divided structure? > Guideline would then again be: for code that must be translated: update > POTFILES.in > > > Benny > > > 2012/10/3 Benny Malengier <ben...@gm...> > >> Ok, >> >> I don't follow everything you wrote :-) >> >> I updated update_po.py, now py.in files are present in gramps.pot also. >> Please test. >> So that is fixed. All works for python 2.7 now. Optionparser is >> deprecated, but not difficult to change to the new system, we can do that >> another time. >> >> About documentation, I meant something in the lines of how to use >> update_po to be up to date for translation or release. The help only >> explains the options. >> >> I don't see the problems in tips, you will have to be more specific if >> there is something I should look at. >> >> The warnings you mention (I suppose you mean the output >> "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string >> with unnamed arguments cannot be properly localized:" >> are things in the translation you can fix >> >> I also fixed a bit for pt_BR output on check, not sure if that is the >> problem you meant. >> >> Lastly, "5. What should be done with: >> /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" >> I don't follow, is there a problem there? intltool-extract is used for >> these, will this stop working? >> >> Benny >> >> >> 2012/10/3 jerome <rom...@ya...> >> >>> > "I removed make and friends now." >>> >>> Oh, so fast! >>> >>> Note, 'update_po' is a mix between 'get_strings' (Gramps 2.0) logic, the >>> way used by Gnome (intltool, POTFILES), Stephen George (Windows port) and >>> Kees Bakker's (check_po)! >>> >>> Currently, only few translators have generated the template for >>> translations via make. On trunk, we just need to check if something is not >>> wrong or missing for a complete 'gramps.pot'. >>> >>> The others flags are just set of commands often used by translators. >>> >>> > "1/add some documentation at top of update_po on how it should be >>> used. To me it is not clear at the moment :-)" >>> >>> python po/update_po.py -h >>> or >>> python po/update_po.py --help >>> >>> You are right maybe because I generated and tested this file, I was >>> aware of existing flags ... :( >>> >>> > "2/update the translation documentation on the wiki, so we have an old >>> page which is for gramps 3.x and before, and a current page on how to do >>> things with gramps 4." >>> >>> Yes, I will do. :) >>> >>> > "update_po seems to run here with python2.7" >>> >>> Maybe when a function is 'deprecated', there is a transition period? >>> ie. still work with 2.7, but will be removed soon? >>> >>> >>> http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator >>> >>> The problem could occur when we try to retrieve strings from tips.xml.inwith python 2.7 and the iteration function: a naming issue (and generator) >>> between python 2.6 and python 2.7 ... :( >>> >>> >>> Note, about the output, there is some minor issues: >>> >>> 1. tips.xml.in has some special cases (not consistent by parsing). >>> During testing it was tips 7 and 18! >>> >>> EOL or something like that, because the quick parser for getting these >>> strings need special cases: >>> >>> tip = tip.replace("\n</_tip>\n", "</_tip>\n") # special case tip 7 >>> tip = tip.replace("\n<b>", "<b>") # special case tip 18 >>> >>> 2. some translation strings might be improved according python mapping! >>> Just run 'update_po -p' for generating a new template and you will see >>> some warnings. It was planned to improve current code. >>> >>> The classical _('%s is %s with %s for %s under %s at %s') >>> >>> What are these variables/values??? >>> How to order them??? >>> >>> >>> http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#Use_named_.25s_values >>> >>> 3. check flag ("-k", "--check") will not properly work for locale with >>> more than two characters (pt_BR, zh_CN)... >>> >>> 4. generated 'gramps.pot' will ignore strings from 'const.py.in'. >>> A reference issue, which is set under 'gramps' file (plain text file). >>> >>> 5. What should be done with: >>> /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys? >>> I guess they were unchanged since many years, but currently they are >>> always parsed (gramps.pot) and regenerated every time during build time >>> (under Linux, BSD, etc ...MacOS?)! >>> >>> All cosmetic issues. >>> >>> >>> Jérôme >>> >>> >>> --- En date de : Mer 3.10.12, Benny Malengier <ben...@gm...> >>> a écrit : >>> >>> De: Benny Malengier <ben...@gm...> >>> Objet: Re: Re : po >>> À: "jerome" <rom...@ya...> >>> Cc: "Gramps Development List" <gra...@li...> >>> Date: Mercredi 3 octobre 2012, 11h34 >>> >>> Jerome, >>> >>> I removed make and friends now. >>> update_po seems to run here with python2.7. >>> >>> If you need help with something, just let me know. >>> It would be great if you: >>> >>> 1/add some documentation at top of update_po on how it should be used. >>> To me it is not clear at the moment :-) >>> >>> >>> 2/update the translation documentation on the wiki, so we have an old >>> page which is for gramps 3.x and before, and a current page on how to do >>> things with gramps 4.9 >>> >>> Benny >>> 2012/10/2 jerome <rom...@ya...> >>> >>> Benny, >>> >>> >>> >>> It is still experimental for handling po files and gramps.pot with >>> python libs and GNU tools only. >>> >>> >>> >>> In fact, it was tested with python 2.6 some months ago... >>> >>> One thing is remaining for a complete support with python 2.7: one >>> "function/set of lines" is still working with python 2.6 only. >>> >>> >>> >>> Something like: >>> >>> >>> >>> from xml.etree import ElementTree >>> >>> >>> >>> tree = ElementTree.parse(filename) >>> >>> root = tree.getroot() >>> >>> >>> >>> mark = _tip >>> >>> >>> >>> for key in root.getiterator(mark): >>> >>> >>> >>> I tested an other way, which seems to be more correct, something like: >>> >>> >>> >>> for key in root.iter(): >>> >>> if key.attrib.get(mark): >>> >>> ... >>> >>> >>> >>> To spare one line does not really makes sense if this does not work >>> after a python update/migration... I suppose it could be one common >>> function for both files who really need to be parsed: 'holidays.xml' and >>> 'tips.xml'. >>> >>> >>> >>> >>> Note, 'optparse' is also a deprecated module under python 2.7 >>> (migration)... http://docs.python.org/library/optparse.html >>> >>> I know that it should rather use 'argparse' with this python version. >>> >>> http://docs.python.org/library/argparse.html#module-argparse >>> >>> >>> >>> > Second, if you test on python version, don't check on the 7, but use >>> instead > or <. >>> >>> >>> >>> Currently, it should still work with python 2.6 and there is a partial >>> support with python 2.7. About python 3.x, I do not think this will work! >>> >>> >>> >>> Yes, the next step will be to support python 2.7 and +. >>> >>> If so, do not need to test for python 2.6 anymore. >>> >>> >>> >>> Note, about translation and 'src->gramps' migration, one module usage is >>> not clear, but I guess it will be modified on next revisions: ' >>> const.py.in'. It is cosmetic. ie. to change 'const.py.in' reference by >>> 'const.py'. Else, 'update_po' has grouped all commands/steps for >>> translation/template handling by using python. >>> >>> >>> >>> >>> John and Rob did not think that getting rid of 'intltool' was useful. >>> >>> If Gramps provides a more 'python-standard' way for installation, I >>> suppose to have a python script for translations might be also useful. >>> >>> It could be also used under others pateforms with few efforts. >>> >>> >>> >>> >>> >>> Thank you for advices about coding. >>> >>> >>> >>> Jérôme >>> >>> >>> >>> --- En date de : Lun 1.10.12, Benny Malengier <ben...@gm...> >>> a écrit : >>> >>> >>> >>> De: Benny Malengier <ben...@gm...> >>> >>> Objet: po >>> >>> À: "Jérôme" <rom...@ya...> >>> >>> Cc: "Gramps Development List" <gra...@li...> >>> >>> Date: Lundi 1 octobre 2012, 19h30 >>> >>> >>> >>> Jerome, >>> >>> >>> >>> I see you changed update_po. Some things. >>> >>> First, trunk requires python 2.7, so it is not needed to do python 2.6 >>> workarounds. >>> >>> Second, if you test on python version, don't check on the 7, but use >>> instead > or <. >>> >>> >>> >>> >>> >>> Benny >>> >>> >>> >>> >>> >>> >>> >>> >>> >> > |
From: Benny M. <ben...@gm...> - 2012-10-03 15:57:20
|
Jerome, update_po has now been changed to automatically scan the py files, so developers no longer need to add .py files somewhere to be scanned. What is needed: 1/ files that should not be scanned: add them to POTFILES.skip 2/ files that the scan does not pick up and should be used: add them to POTFILES.in Please check nothing is missing. Benny 2012/10/3 Benny Malengier <ben...@gm...> > > > 2012/10/3 Benny Malengier <ben...@gm...> > >> One more thing. >> I don't like the name gramps for the list of files. Can we use >> POTFILES.in again? >> We can remove POTFILES.skip I suppose and that gramps file then. >> > > I changed my mind. I would like to have it automatic, and only blacklist > things. I'll quickly try that. > > Benny > > >> >> It sufficies there to svn skip empty lines or lines starting with #, >> which is the case in >> latest rev 20502. >> >> So if you could move back to POTFILES.in with the nice in directories >> divided structure? >> Guideline would then again be: for code that must be translated: update >> POTFILES.in >> >> >> Benny >> >> >> 2012/10/3 Benny Malengier <ben...@gm...> >> >>> Ok, >>> >>> I don't follow everything you wrote :-) >>> >>> I updated update_po.py, now py.in files are present in gramps.pot also. >>> Please test. >>> So that is fixed. All works for python 2.7 now. Optionparser is >>> deprecated, but not difficult to change to the new system, we can do that >>> another time. >>> >>> About documentation, I meant something in the lines of how to use >>> update_po to be up to date for translation or release. The help only >>> explains the options. >>> >>> I don't see the problems in tips, you will have to be more specific if >>> there is something I should look at. >>> >>> The warnings you mention (I suppose you mean the output >>> "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string >>> with unnamed arguments cannot be properly localized:" >>> are things in the translation you can fix >>> >>> I also fixed a bit for pt_BR output on check, not sure if that is the >>> problem you meant. >>> >>> Lastly, "5. What should be done with: >>> /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" >>> I don't follow, is there a problem there? intltool-extract is used for >>> these, will this stop working? >>> >>> Benny >>> >>> >>> 2012/10/3 jerome <rom...@ya...> >>> >>>> > "I removed make and friends now." >>>> >>>> Oh, so fast! >>>> >>>> Note, 'update_po' is a mix between 'get_strings' (Gramps 2.0) logic, >>>> the way used by Gnome (intltool, POTFILES), Stephen George (Windows port) >>>> and Kees Bakker's (check_po)! >>>> >>>> Currently, only few translators have generated the template for >>>> translations via make. On trunk, we just need to check if something is not >>>> wrong or missing for a complete 'gramps.pot'. >>>> >>>> The others flags are just set of commands often used by translators. >>>> >>>> > "1/add some documentation at top of update_po on how it should be >>>> used. To me it is not clear at the moment :-)" >>>> >>>> python po/update_po.py -h >>>> or >>>> python po/update_po.py --help >>>> >>>> You are right maybe because I generated and tested this file, I was >>>> aware of existing flags ... :( >>>> >>>> > "2/update the translation documentation on the wiki, so we have an >>>> old page which is for gramps 3.x and before, and a current page on how to >>>> do things with gramps 4." >>>> >>>> Yes, I will do. :) >>>> >>>> > "update_po seems to run here with python2.7" >>>> >>>> Maybe when a function is 'deprecated', there is a transition period? >>>> ie. still work with 2.7, but will be removed soon? >>>> >>>> >>>> http://docs.python.org/library/xml.etree.elementtree.html#xml.etree.ElementTree.Element.getiterator >>>> >>>> The problem could occur when we try to retrieve strings from >>>> tips.xml.in with python 2.7 and the iteration function: a naming issue >>>> (and generator) between python 2.6 and python 2.7 ... :( >>>> >>>> >>>> Note, about the output, there is some minor issues: >>>> >>>> 1. tips.xml.in has some special cases (not consistent by parsing). >>>> During testing it was tips 7 and 18! >>>> >>>> EOL or something like that, because the quick parser for getting these >>>> strings need special cases: >>>> >>>> tip = tip.replace("\n</_tip>\n", "</_tip>\n") # special case tip 7 >>>> tip = tip.replace("\n<b>", "<b>") # special case tip 18 >>>> >>>> 2. some translation strings might be improved according python mapping! >>>> Just run 'update_po -p' for generating a new template and you will see >>>> some warnings. It was planned to improve current code. >>>> >>>> The classical _('%s is %s with %s for %s under %s at %s') >>>> >>>> What are these variables/values??? >>>> How to order them??? >>>> >>>> >>>> http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#Use_named_.25s_values >>>> >>>> 3. check flag ("-k", "--check") will not properly work for locale with >>>> more than two characters (pt_BR, zh_CN)... >>>> >>>> 4. generated 'gramps.pot' will ignore strings from 'const.py.in'. >>>> A reference issue, which is set under 'gramps' file (plain text file). >>>> >>>> 5. What should be done with: >>>> /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys? >>>> I guess they were unchanged since many years, but currently they are >>>> always parsed (gramps.pot) and regenerated every time during build time >>>> (under Linux, BSD, etc ...MacOS?)! >>>> >>>> All cosmetic issues. >>>> >>>> >>>> Jérôme >>>> >>>> >>>> --- En date de : Mer 3.10.12, Benny Malengier < >>>> ben...@gm...> a écrit : >>>> >>>> De: Benny Malengier <ben...@gm...> >>>> Objet: Re: Re : po >>>> À: "jerome" <rom...@ya...> >>>> Cc: "Gramps Development List" <gra...@li...> >>>> Date: Mercredi 3 octobre 2012, 11h34 >>>> >>>> Jerome, >>>> >>>> I removed make and friends now. >>>> update_po seems to run here with python2.7. >>>> >>>> If you need help with something, just let me know. >>>> It would be great if you: >>>> >>>> 1/add some documentation at top of update_po on how it should be used. >>>> To me it is not clear at the moment :-) >>>> >>>> >>>> 2/update the translation documentation on the wiki, so we have an old >>>> page which is for gramps 3.x and before, and a current page on how to do >>>> things with gramps 4.9 >>>> >>>> Benny >>>> 2012/10/2 jerome <rom...@ya...> >>>> >>>> Benny, >>>> >>>> >>>> >>>> It is still experimental for handling po files and gramps.pot with >>>> python libs and GNU tools only. >>>> >>>> >>>> >>>> In fact, it was tested with python 2.6 some months ago... >>>> >>>> One thing is remaining for a complete support with python 2.7: one >>>> "function/set of lines" is still working with python 2.6 only. >>>> >>>> >>>> >>>> Something like: >>>> >>>> >>>> >>>> from xml.etree import ElementTree >>>> >>>> >>>> >>>> tree = ElementTree.parse(filename) >>>> >>>> root = tree.getroot() >>>> >>>> >>>> >>>> mark = _tip >>>> >>>> >>>> >>>> for key in root.getiterator(mark): >>>> >>>> >>>> >>>> I tested an other way, which seems to be more correct, something like: >>>> >>>> >>>> >>>> for key in root.iter(): >>>> >>>> if key.attrib.get(mark): >>>> >>>> ... >>>> >>>> >>>> >>>> To spare one line does not really makes sense if this does not work >>>> after a python update/migration... I suppose it could be one common >>>> function for both files who really need to be parsed: 'holidays.xml' and >>>> 'tips.xml'. >>>> >>>> >>>> >>>> >>>> Note, 'optparse' is also a deprecated module under python 2.7 >>>> (migration)... http://docs.python.org/library/optparse.html >>>> >>>> I know that it should rather use 'argparse' with this python version. >>>> >>>> http://docs.python.org/library/argparse.html#module-argparse >>>> >>>> >>>> >>>> > Second, if you test on python version, don't check on the 7, but use >>>> instead > or <. >>>> >>>> >>>> >>>> Currently, it should still work with python 2.6 and there is a partial >>>> support with python 2.7. About python 3.x, I do not think this will work! >>>> >>>> >>>> >>>> Yes, the next step will be to support python 2.7 and +. >>>> >>>> If so, do not need to test for python 2.6 anymore. >>>> >>>> >>>> >>>> Note, about translation and 'src->gramps' migration, one module usage >>>> is not clear, but I guess it will be modified on next revisions: ' >>>> const.py.in'. It is cosmetic. ie. to change 'const.py.in' reference by >>>> 'const.py'. Else, 'update_po' has grouped all commands/steps for >>>> translation/template handling by using python. >>>> >>>> >>>> >>>> >>>> John and Rob did not think that getting rid of 'intltool' was useful. >>>> >>>> If Gramps provides a more 'python-standard' way for installation, I >>>> suppose to have a python script for translations might be also useful. >>>> >>>> It could be also used under others pateforms with few efforts. >>>> >>>> >>>> >>>> >>>> >>>> Thank you for advices about coding. >>>> >>>> >>>> >>>> Jérôme >>>> >>>> >>>> >>>> --- En date de : Lun 1.10.12, Benny Malengier < >>>> ben...@gm...> a écrit : >>>> >>>> >>>> >>>> De: Benny Malengier <ben...@gm...> >>>> >>>> Objet: po >>>> >>>> À: "Jérôme" <rom...@ya...> >>>> >>>> Cc: "Gramps Development List" <gra...@li...> >>>> >>>> Date: Lundi 1 octobre 2012, 19h30 >>>> >>>> >>>> >>>> Jerome, >>>> >>>> >>>> >>>> I see you changed update_po. Some things. >>>> >>>> First, trunk requires python 2.7, so it is not needed to do python 2.6 >>>> workarounds. >>>> >>>> Second, if you test on python version, don't check on the 7, but use >>>> instead > or <. >>>> >>>> >>>> >>>> >>>> >>>> Benny >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>> >> > |
From: jerome <rom...@ya...> - 2012-10-03 16:02:42
|
> "I don't follow everything you wrote :-)" +1 for what I have written !!! and some words were also missing on some of my sentences... :( > "I updated update_po.py, now py.in files are present in gramps.pot also. Please test. So that is fixed. All works for python 2.7 now." Note, as I dislike last Gnome3 (shell) desktop under Ubuntu 12.04LTS...despite it was OK for testing trunk, I was not confortable for an every day use. I have planned to use something like ElementaryOS 'luna' (no released yet) http://sourceforge.net/projects/elementaryos/files/unstable/ Related to Ubuntu, I suppose it will be also possible to get the same environment but I hope under a more simplier, flexible an accessible desktop ... Right now, I still have an other distribution with python 2.6 ... No complete 'trunk' environment with python 2.7, right now. > I don't see the problems in tips, you will have to be more specific if there is something I should look at. It returns a cryptic warning, not only related to the french translation, but to the warning itself. Something like 'unclosed string'. xgettext for ../gramps/data/tips.xml.in.h ../gramps/data/tips.xml.in.h:6 : AVERTISSEMENT : chaîne sans terminaison ../gramps/data/tips.xml.in.h:7 : AVERTISSEMENT : chaîne sans terminaison ../gramps/data/tips.xml.in.h:18 : AVERTISSEMENT : chaîne sans terminaison ../gramps/data/tips.xml.in.h:19 : AVERTISSEMENT : chaîne sans terminaison ../gramps/data/tips.xml.in.h:18 : AVERTISSEMENT : Chaîne « msgid » vide. Cet usage est réservé par GNU gettext : gettext("") retourne l'en-tête avec les informations de contexte, pas une chaîne vide. It just seems that: * tip number 6 is missing * close markup of tip 7 uses a new empty line * an empty line as first character after start markup into tip 18 ? Note, that's why there is a workaround on update_po.py ! As said, it was cosmetic and it was planned to make these changes after your major changes on all gramps files (avoid conflicts). I made a bug report for that: #6086. I am able to test your changes (I reverted iter() for tests, cause of my python 2.6...). > "I also fixed a bit for pt_BR output on check, not sure if that is the problem you meant." Yes. Thank you! > "/data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" I don't follow, is there a problem there? intltool-extract is used for these, will this stop working?" Yes, but what happen if you do not have perl or not provided by default under your OS libs (ex: Windows). I know that I could also past the strings directly into the python script when it needs to test 'gramps.pot' generation. But for going further, if we do not need intltool (extract and merge) then the code sounds more 'python'. Once more it is not very important: a minor feature or possible issue. > "One more thing. I don't like the name gramps for the list of files." +1 'gramps' was rather a temp name for testing! > "Can we use POTFILES.in again?" Yes. > "We can remove POTFILES.skip I suppose and that gramps file then. I changed my mind. I would like to have it automatic, and only blacklist things. I'll quickly try that." I see: to check all files except skipped references? Note, we could also try to ignore/remove translation (marks and modules) into files listed under 'POTFILES.skip', because they are currently not visible for users : do not really need to translate them or call gettext module (memory optimisation?). Jérôme --- En date de : Mer 3.10.12, Benny Malengier <ben...@gm...> a écrit : De: Benny Malengier <ben...@gm...> Objet: Re: Re : po À: "jerome" <rom...@ya...> Cc: "Gramps Development List" <gra...@li...> Date: Mercredi 3 octobre 2012, 17h11 2012/10/3 Benny Malengier <ben...@gm...> One more thing. I don't like the name gramps for the list of files. Can we use POTFILES.in again? We can remove POTFILES.skip I suppose and that gramps file then. I changed my mind. I would like to have it automatic, and only blacklist things. I'll quickly try that. Benny It sufficies there to svn skip empty lines or lines starting with #, which is the case in latest rev 20502. So if you could move back to POTFILES.in with the nice in directories divided structure? Guideline would then again be: for code that must be translated: update POTFILES.in Benny 2012/10/3 Benny Malengier <ben...@gm...> Ok, I don't follow everything you wrote :-) I updated update_po.py, now py.in files are present in gramps.pot also. Please test. So that is fixed. All works for python 2.7 now. Optionparser is deprecated, but not difficult to change to the new system, we can do that another time. About documentation, I meant something in the lines of how to use update_po to be up to date for translation or release. The help only explains the options. I don't see the problems in tips, you will have to be more specific if there is something I should look at. The warnings you mention (I suppose you mean the output "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string with unnamed arguments cannot be properly localized:" are things in the translation you can fix I also fixed a bit for pt_BR output on check, not sure if that is the problem you meant. Lastly, "5. What should be done with: /data/gramps.xml, /data/gramps.desktop, /data/gramps.keys?" I don't follow, is there a problem there? intltool-extract is used for these, will this stop working? Benny |
From: jerome <rom...@ya...> - 2012-10-04 14:24:04
|
Benny, After tests, maybe to monitor, check or review some references into POTFILES.in/POTFILES.skip! 1. commented lines on POTFILES.in: #gramps/gen/plug/export/_exportassistant.py #gramps/gen/plug/export/_exportoptions.py #gramps/config.py #gramps/docgen/ODSTab.py #gramps/docgen/TextBufDoc.py #gramps/plugins/gramplet/metadataviewer.py #gramps/plugins/import/importgrdb.py #gramps/plugins/lib/maps/osmgps.py #gramps/plugins/quickview/query.py #gramps/gui/glade/dateedit.glade --- 2. most based filter rules (not all) could move to POTFILES.skip (do not use/display/translate factory for 'object'!) gramps/gen/filters/rules/_hassourceofbase.py --- 3. test with the french translation update_po.py: 5777 messages traduits, 91 traductions approximatives, 58 messages non traduits. intltool: 5780 messages traduits, 151 traductions approximatives, 83 messages non traduits It seems that we could try to update POTFILES.in/POTFILES.skip! To make it more consistent. Often related to import/export on .glade files: we just need 'importgedcom.glade'. There is a common code on export assistant for all formats, isn't it? Why some 'alone' entry into 'gramps/plugins/tool/phpgedview.glade'? I do not know! Why on some strings of gramps/gui/glade/rule.glade? I do not know! The list of differences (reference issues): #: ../gramps/plugins/tool/phpgedview.glade.h:1 < msgid "- default -" #: ../gramps/plugins/import/importgedcom.glade.h:4 < msgid "ANSEL" #: ../gramps/plugins/import/importgedcom.glade.h:5 < msgid "ANSI (iso-8859-1)" #: ../gramps/plugins/import/importgedcom.glade.h:6 < msgid "ASCII" #: ../gramps/gui/glade/rule.glade.h:11 < msgid "All rules must apply" #: ../gramps/gui/glade/rule.glade.h:12 < msgid "At least one rule must apply" #: ../gramps/gui/glade/rule.glade.h:21 < msgid "Exactly one rule must apply" #: ../gramps/plugins/import/importgedcom.glade.h:15 < msgid "UTF8" #: ../gramps/plugins/export/exportgeneweb.glade:190 > msgid "Exclude _notes" #: ../gramps/plugins/export/exportcsv.glade:272 > msgid "Export:" #: ../gramps/plugins/export/exportcsv.glade:127 #: ../gramps/plugins/export/exportftree.glade:133 #: ../gramps/plugins/export/exportgeneweb.glade:135 #: ../gramps/plugins/export/exportvcalendar.glade:114 #: ../gramps/plugins/export/exportvcard.glade:123 > msgid "Filt_er:" #: ../gramps/plugins/export/exportcsv.glade:208 > msgid "I_ndividuals" #: ../gramps/gen/db/write.py:980 > msgid "Rebuild reference map" #: ../gramps/plugins/export/exportgeneweb.glade:255 > msgid "Reference i_mages from path: " #: ../gramps/plugins/export/exportcsv.glade:238 > msgid "Translate _Headers" #: ../gramps/plugins/export/exportgeneweb.glade:212 > msgid "Use _Living as first name" #: ../gramps/plugins/export/exportcsv.glade:164 > msgid "_Marriages" #: ../gramps/plugins/export/exportftree.glade:147 #: ../gramps/plugins/export/exportgeneweb.glade:149 > msgid "_Restrict data on living people" --- 4. import issue into some plugins (see po/test): ====================================================================== FAIL: test_gettext_py_0411 (__main__.TestGetText) ---------------------------------------------------------------------- Traceback (most recent call last): File "po_test.py", line 106, in <lambda> self.__dict__[method_name] = lambda: self.helper(pofile, searches) File "po_test.py", line 119, in helper (pofile, searches)) AssertionError: 'gramps/gui/widgets/fanchart.py' is in POTFILES.in but does not contain '['import gettext', 'from gen.ggettext', 'import sgettext']' ====================================================================== FAIL: test_gettext_py_0412 (__main__.TestGetText) ---------------------------------------------------------------------- Traceback (most recent call last): File "po_test.py", line 106, in <lambda> self.__dict__[method_name] = lambda: self.helper(pofile, searches) File "po_test.py", line 119, in helper (pofile, searches)) AssertionError: 'gramps/gui/widgets/fanchartdesc.py' is in POTFILES.in but does not contain '['import gettext', 'from gen.ggettext', 'import sgettext']' ====================================================================== FAIL: test_gettext_py_0492 (__main__.TestGetText) ---------------------------------------------------------------------- Traceback (most recent call last): File "po_test.py", line 106, in <lambda> self.__dict__[method_name] = lambda: self.helper(pofile, searches) File "po_test.py", line 119, in helper (pofile, searches)) AssertionError: 'gramps/plugins/lib/libnarrate.py' is in POTFILES.in but does not contain '['import gettext', 'from gen.ggettext', 'import sgettext']' ---------------------------------------------------------------------- Ran 650 tests in 0.152s 5. There is a problem with comments into 'gramps.pot' file when we try to generate a new template. There is around 4ko of comments (generated when we add a comment just the line(s) before the translation string into the python code!). It looks like: #. Apply the filter #. Sort the people as requested #: ../gramps/plugins/drawreport/timeline.py:111 #: ../gramps/plugins/drawreport/timeline.py:138 #: ../gramps/plugins/drawreport/timeline.py:150 But if 'gramps.po' file already exists, we add these comments every time, even if they are already into 'gramps.pot'... #. Apply the filter #. Sort the people as requested #. Apply the filter #. Sort the people as requested #: ../gramps/plugins/drawreport/timeline.py:111 #: ../gramps/plugins/drawreport/timeline.py:138 #: ../gramps/plugins/drawreport/timeline.py:150 etc ... It increase the file size of 'gramps.pot' on every file generation. It is maybe related to the use of 'add-comments' and 'join' options when we call 'xgettext' with 'python.txt'. I do not remember having this problem before and I do not see what could be the cause on last changes! I suppose that I can already remove 'po/gramps' file on SVN (trunk)? It works for me and above issues are now listed. I should be able to fix some of them. PS: Peter, There is "fatal errors" on 'sv.po' (trunk). sv.po:10522: number of format specifications in 'msgid' and 'msgstr' does not match sv.po:10735: format specifications in 'msgid' expect a mapping, those in 'msgstr' expect a tuple sv.po:24410: format specifications in 'msgid_plural' expect a mapping, those in 'msgstr[0]' expect a tuple --- En date de : Mer 3.10.12, Benny Malengier <ben...@gm...> a écrit : De: Benny Malengier <ben...@gm...> Objet: Re: Re : po À: "jerome" <rom...@ya...> Cc: "Gramps Development List" <gra...@li...> Date: Mercredi 3 octobre 2012, 17h57 Jerome, update_po has now been changed to automatically scan the py files, so developers no longer need to add .py files somewhere to be scanned. What is needed: 1/ files that should not be scanned: add them to POTFILES.skip 2/ files that the scan does not pick up and should be used: add them to POTFILES.in Please check nothing is missing. Benny |
From: jerome <rom...@ya...> - 2012-10-08 15:23:43
Attachments:
6086.patch
|
Benny, > "The warnings you mention (I suppose you mean the output "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string with unnamed arguments cannot be properly localized:" are things in the translation you can fix" I added a possible patch on bug #6086[1]. Fixes/Improvements are classical python mapping. Maybe possible issues on: * gramps/plugins/textreport/indivcomplete.py use of combine function??? * gramps/plugins/mapservices/eniroswedenmap.py I was not able to understand: msg2 = _("Latitude not within %s to %s\n") + \ _("Longitude not within %s to %s") msg2 = msg2 % (54.55, 69.05, 8.05, 24.15) Is there any conversion somewhere for using a second line with msg2? Also, 'gramps/gen/db/upgrade.py' from line 83 to 88 is already using something like a map. I do not know how to make any change there! Jérôme [1] http://www.gramps-project.org/bugs/view.php?id=6086 |
From: Peter L. <pet...@te...> - 2012-10-09 09:41:48
|
jerome skrev 2012-10-08 17:23: > Benny, > >> "The warnings you mention (I suppose you mean the output "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format string with unnamed arguments cannot be properly localized:" > are things in the translation you can fix" > > I added a possible patch on bug #6086[1]. > > Fixes/Improvements are classical python mapping. > > Maybe possible issues on: > > * gramps/plugins/textreport/indivcomplete.py > use of combine function??? > > * gramps/plugins/mapservices/eniroswedenmap.py > I was not able to understand: > msg2 = _("Latitude not within %s to %s\n") + \ > _("Longitude not within %s to %s") > msg2 = msg2 % (54.55, 69.05, 8.05, 24.15) > Is there any conversion somewhere for using a second line with msg2? What's the problem? It works very well in 3.4.1 at least. /Peter > > Also, 'gramps/gen/db/upgrade.py' from line 83 to 88 is already using something like a map. I do not know how to make any change there! > > > Jérôme > > > [1] http://www.gramps-project.org/bugs/view.php?id=6086 > > > ------------------------------------------------------------------------------ > Don't let slow site performance ruin your business. Deploy New Relic APM > Deploy New Relic app performance management and know exactly > what is happening inside your Ruby, Python, PHP, Java, and .NET app > Try New Relic at no cost today and get our sweet Data Nerd shirt too! > http://p.sf.net/sfu/newrelic-dev2dev > > > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel |
From: Jérôme <rom...@ya...> - 2012-10-09 10:36:05
|
> What's the problem? It works very well in 3.4.1 at least. No problem! Sure, the translation works well but.. try: $ xgettext --keyword=_ trunk/gramps/plugins/mapservice/eniroswedenmap.py eniroswedenmap.py:139 : AVERTISSEMENT : La chaîne de format 'msgid' avec des arguments non nommés ne peut pas être correctement localisée : Le traducteur ne peut pas réordonner les arguments. Envisagez d'utiliser une chaîne de format contenant des arguments nommés, et un mapping plutôt qu'un tuple pour les arguments. eniroswedenmap.py:140 : AVERTISSEMENT : La chaîne de format 'msgid' avec des arguments non nommés ne peut pas être correctement localisée : ... => warning: 'msgid' format string with unnamed arguments cannot be properly localized: A possible improvement for trunk is maybe to avoid multiple (when more than one) simple strings/decimal variables: unnamed arguments. What is the most accessible for translators: #: ../gramps/plugins/mapservices/eniroswedenmap.py:139 msgid "Latitude not within %s to %s\n" or msgid "Latitude not within '54.55' to '69.05'\n" #: ../gramps/plugins/mapservices/eniroswedenmap.py:140 msgid "Longitude not within %s to %s" or msgid "Longitude not within '8.05' to '24.15'" I was just wondering if the current string: "msg2 = msg2 % (54.55, 69.05, 8.05, 24.15)" does not make something special? It is like a map with decimal values, then translated as strings! My guess was that there was maybe a conversion for coordinates, somewhere? So, I did not make change, despite the fact that it could be improved for python usage! Jérôme Le 09/10/2012 11:41, Peter Landgren a écrit : > jerome skrev 2012-10-08 17:23: >> Benny, >> >>> "The warnings you mention (I suppose you mean the output >>> "../gramps/plugins/view/relview.py:1206: warning: 'msgid' format >>> string with unnamed arguments cannot be properly localized:" >> are things in the translation you can fix" >> >> I added a possible patch on bug #6086[1]. >> >> Fixes/Improvements are classical python mapping. >> >> Maybe possible issues on: >> >> * gramps/plugins/textreport/indivcomplete.py >> use of combine function??? >> >> * gramps/plugins/mapservices/eniroswedenmap.py >> I was not able to understand: >> msg2 = _("Latitude not within %s to %s\n") + \ >> _("Longitude not within %s to %s") >> msg2 = msg2 % (54.55, 69.05, 8.05, 24.15) >> Is there any conversion somewhere for using a second line with msg2? > What's the problem? It works very well in 3.4.1 at least. > > /Peter > >> >> Also, 'gramps/gen/db/upgrade.py' from line 83 to 88 is already using >> something like a map. I do not know how to make any change there! >> >> >> Jérôme >> >> >> [1] http://www.gramps-project.org/bugs/view.php?id=6086 >> >> >> ------------------------------------------------------------------------------ >> >> Don't let slow site performance ruin your business. Deploy New Relic APM >> Deploy New Relic app performance management and know exactly >> what is happening inside your Ruby, Python, PHP, Java, and .NET app >> Try New Relic at no cost today and get our sweet Data Nerd shirt too! >> http://p.sf.net/sfu/newrelic-dev2dev >> >> >> _______________________________________________ >> Gramps-devel mailing list >> Gra...@li... >> https://lists.sourceforge.net/lists/listinfo/gramps-devel > > |
From: Benny M. <ben...@gm...> - 2012-10-02 13:52:03
|
2012/10/2 jerome <rom...@ya...> > > "Alternatively, I could keep the Makefiles for po generation." > > It seems that current translation environment (POTFILES.in POTFILE.skip, > Makefile.am) is related to configure.in! > Inherited from Gnome... > > > http://www.gramps-project.org/wiki/index.php?title=Coding_for_translation#How_it_works > > http://people.gnome.org/~malcolm/i18n/makefile-changes.html > > An illustration could be the "unittest for testing POTFILES.in and > Makefile contents": > http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/po/test/po_test.py > > 'configure/Makefile' are related, and to only provide Makefile for po > generation will maybe mean to keep 'configure/makefile' framework for all > gramps' modules! > > Note, the 'po/test/po_test.py' script was for testing missing references > into Makefile.am or POTFILES.in and POTFILE.skip. To keep Makefiles mean to > still deal with these possible missing references!!! > I defenitely don't want to update anymore Makefile.in However, to update POTFILES would be possible... I'll look at it when finished with the import problems. Benny > > > Jérôme > > --- En date de : Mar 2.10.12, Benny Malengier <ben...@gm...> > a écrit : > > De: Benny Malengier <ben...@gm...> > Objet: Re: Re : po > À: "jerome" <rom...@ya...> > Cc: "Gramps Development List" <gra...@li...> > Date: Mardi 2 octobre 2012, 10h28 > > Alternatively, I could keep the Makefiles for po generation. > People installing Gramps don't need to run make, but you would have to do > it in the po directory. > > Benny > > 2012/10/2 jerome <rom...@ya...> > > Benny, > > > > It is still experimental for handling po files and gramps.pot with python > libs and GNU tools only. > > > > In fact, it was tested with python 2.6 some months ago... > > One thing is remaining for a complete support with python 2.7: one > "function/set of lines" is still working with python 2.6 only. > > > > Something like: > > > > from xml.etree import ElementTree > > > > tree = ElementTree.parse(filename) > > root = tree.getroot() > > > > mark = _tip > > > > for key in root.getiterator(mark): > > > > I tested an other way, which seems to be more correct, something like: > > > > for key in root.iter(): > > if key.attrib.get(mark): > > ... > > > > To spare one line does not really makes sense if this does not work after > a python update/migration... I suppose it could be one common function for > both files who really need to be parsed: 'holidays.xml' and 'tips.xml'. > > > > > Note, 'optparse' is also a deprecated module under python 2.7 > (migration)... http://docs.python.org/library/optparse.html > > I know that it should rather use 'argparse' with this python version. > > http://docs.python.org/library/argparse.html#module-argparse > > > > > Second, if you test on python version, don't check on the 7, but use > instead > or <. > > > > Currently, it should still work with python 2.6 and there is a partial > support with python 2.7. About python 3.x, I do not think this will work! > > > > Yes, the next step will be to support python 2.7 and +. > > If so, do not need to test for python 2.6 anymore. > > > > Note, about translation and 'src->gramps' migration, one module usage is > not clear, but I guess it will be modified on next revisions: 'const.py.in'. > It is cosmetic. ie. to change 'const.py.in' reference by 'const.py'. > Else, 'update_po' has grouped all commands/steps for translation/template > handling by using python. > > > > > John and Rob did not think that getting rid of 'intltool' was useful. > > If Gramps provides a more 'python-standard' way for installation, I > suppose to have a python script for translations might be also useful. > > It could be also used under others pateforms with few efforts. > > > > > > Thank you for advices about coding. > > > > Jérôme > > > > --- En date de : Lun 1.10.12, Benny Malengier <ben...@gm...> > a écrit : > > > > De: Benny Malengier <ben...@gm...> > > Objet: po > > À: "Jérôme" <rom...@ya...> > > Cc: "Gramps Development List" <gra...@li...> > > Date: Lundi 1 octobre 2012, 19h30 > > > > Jerome, > > > > I see you changed update_po. Some things. > > First, trunk requires python 2.7, so it is not needed to do python 2.6 > workarounds. > > Second, if you test on python version, don't check on the 7, but use > instead > or <. > > > > > > Benny > > > > > > > > > |