Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

zope.app.locales i18nmergeall.py not used anymore?

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


m.van.rees at zestsoftware

Apr 25, 2008, 2:27 PM

Post #1 of 5 (317 views)
Permalink
zope.app.locales i18nmergeall.py not used anymore?

Hi,

zope/app/locales/TRANSLATE.txt says:

...
After that, you need to merge those changes to all existing
translations. You can do that by executing the ``i18nmergeall.py``
script from the ``utilities`` directory of your Zope 3 checkout:

$ python utilities/i18nmergeall.py -l src/zope/app/locales

So I tried that and found that in the 13 po files that are present,
over 80 thousand lines were changed (counting all lines in an svn
diff). Since the files combined have about 100 thousand lines, this
could be called a fairly big change. :)

So: is there a reason this merging is not regularly done anymore? Or
can I just go ahead and submit those 80 thousand lines?


Perhaps the zope.pot file should also be updated. I get an error when
trying that though. This is in a checkout of
svn.zope.org/repos/main/Zope3/trunk, with 'make' and 'make inplace'
executed as they seemed necessary and with the Zope3/src/ dir on my
PYTHONPATH:

maurits[at]hobb:~/svn/Zope3 $ python2.4 utilities/i18nextract.py -d zope -p src/zope -o app/locales
base path: '/home/maurits/svn/Zope3/'
search path: /home/maurits/svn/Zope3/src/zope
'site.zcml' location: None
exclude dirs: []
domain: 'zope'
include default domain: True
output file: '/home/maurits/svn/Zope3/src/zope/app/locales/zope.pot'
Python only: False
Traceback (most recent call last):
File "utilities/i18nextract.py", line 175, in ?
main()
File "utilities/i18nextract.py", line 163, in main
maker.add(zcml_strings(path, domain, site_zcml), base_dir)
File "/home/maurits/svn/Zope3/src/zope/app/locales/extract.py", line 441, in zcml_strings
context = config(site_zcml, features=("devmode",), execute=False)
File "/home/maurits/svn/Zope3/src/zope/app/appsetup/appsetup.py", line 111, in config
context = xmlconfig.file(file, context=context, execute=execute)
File "/home/maurits/svn/Zope3/src/zope/configuration/xmlconfig.py", line 610, in file
include(context, name, package)
File "/home/maurits/svn/Zope3/src/zope/configuration/xmlconfig.py", line 539, in include
f = openInOrPlain(path)
File "/home/maurits/svn/Zope3/src/zope/configuration/xmlconfig.py", line 427, in openInOrPlain
fp = open(filename)
IOError: [Errno 2] No such file or directory: '/home/maurits/svn/Zope3/configure.zcml'


Ah, pointing the script at site.zcml helps:

maurits[at]hobb:~/svn/Zope3 $ python2.4 utilities/i18nextract.py -s site.zcml -d zope -p src/zope -o app/locales

Then about a thousand lines are changed in the zope.pot file. So
apparently this is also not done every day. :-) Is it okay to commit
those changes as well (and merge those changes to the po files of
course)?

Should i18nextract.py be run with Zope3 trunk or with branches/3.4?
It may very well be that the number of changes are far less big when
run inside that branch.

Internationally yours,

--
Maurits van Rees | http://maurits.vanrees.org/
Work | http://zestsoftware.nl/
"This is your day, don't let them take it away." [Barlow Girl]

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


ccomb at free

Apr 26, 2008, 1:25 AM

Post #2 of 5 (289 views)
Permalink
Re: zope.app.locales i18nmergeall.py not used anymore? [In reply to]

Maurits van Rees a écrit :
> Hi,
>
> zope/app/locales/TRANSLATE.txt says:
>
> ...
> After that, you need to merge those changes to all existing
> translations. You can do that by executing the ``i18nmergeall.py``
> script from the ``utilities`` directory of your Zope 3 checkout:
>
> $ python utilities/i18nmergeall.py -l src/zope/app/locales
>
> So I tried that and found that in the 13 po files that are present,
> over 80 thousand lines were changed (counting all lines in an svn
> diff). Since the files combined have about 100 thousand lines, this
> could be called a fairly big change. :)
>
> So: is there a reason this merging is not regularly done anymore? Or
> can I just go ahead and submit those 80 thousand lines?

It seems too big, that's weird.
I think merging is not really done, and there are several changes to do for i18n:

- split the "zope" gettext domain into all the separate namespaces. Maybe only
zope.app.* packages can be kept under the "zope.app" domain.

- find a way to generate the .pot and .mo files at build. They should not be
stored in the svn. We should only have the translated .po files, and the merging
and compiling should be done during build. Maybe the .pot file could be also
stored but this is not really necessary.

- add an automatic test in each package to check whether the .po files have been
merged by the developer. If a po file is not in sync with the code, the test
fails. This would allow all the .po files to be always up to date.

Christophe

>
>
> Perhaps the zope.pot file should also be updated. I get an error when
> trying that though. This is in a checkout of
> svn.zope.org/repos/main/Zope3/trunk, with 'make' and 'make inplace'
> executed as they seemed necessary and with the Zope3/src/ dir on my
> PYTHONPATH:
>
> maurits[at]hobb:~/svn/Zope3 $ python2.4 utilities/i18nextract.py -d zope -p src/zope -o app/locales
> base path: '/home/maurits/svn/Zope3/'
> search path: /home/maurits/svn/Zope3/src/zope
> 'site.zcml' location: None
> exclude dirs: []
> domain: 'zope'
> include default domain: True
> output file: '/home/maurits/svn/Zope3/src/zope/app/locales/zope.pot'
> Python only: False
> Traceback (most recent call last):
> File "utilities/i18nextract.py", line 175, in ?
> main()
> File "utilities/i18nextract.py", line 163, in main
> maker.add(zcml_strings(path, domain, site_zcml), base_dir)
> File "/home/maurits/svn/Zope3/src/zope/app/locales/extract.py", line 441, in zcml_strings
> context = config(site_zcml, features=("devmode",), execute=False)
> File "/home/maurits/svn/Zope3/src/zope/app/appsetup/appsetup.py", line 111, in config
> context = xmlconfig.file(file, context=context, execute=execute)
> File "/home/maurits/svn/Zope3/src/zope/configuration/xmlconfig.py", line 610, in file
> include(context, name, package)
> File "/home/maurits/svn/Zope3/src/zope/configuration/xmlconfig.py", line 539, in include
> f = openInOrPlain(path)
> File "/home/maurits/svn/Zope3/src/zope/configuration/xmlconfig.py", line 427, in openInOrPlain
> fp = open(filename)
> IOError: [Errno 2] No such file or directory: '/home/maurits/svn/Zope3/configure.zcml'
>
>
> Ah, pointing the script at site.zcml helps:
>
> maurits[at]hobb:~/svn/Zope3 $ python2.4 utilities/i18nextract.py -s site.zcml -d zope -p src/zope -o app/locales
>
> Then about a thousand lines are changed in the zope.pot file. So
> apparently this is also not done every day. :-) Is it okay to commit
> those changes as well (and merge those changes to the po files of
> course)?
>
> Should i18nextract.py be run with Zope3 trunk or with branches/3.4?
> It may very well be that the number of changes are far less big when
> run inside that branch.
>
> Internationally yours,
>

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


cz at gocept

Apr 30, 2008, 6:31 AM

Post #3 of 5 (263 views)
Permalink
Re: zope.app.locales i18nmergeall.py not used anymore? [In reply to]

On 2008-04-26 10:25:16 +0200, Christophe Combelles <ccomb[at]free.fr> said:

> Maurits van Rees a écrit :
>> Hi,
>>
>> zope/app/locales/TRANSLATE.txt says:
>>
>> ...
>> After that, you need to merge those changes to all existing
>> translations. You can do that by executing the ``i18nmergeall.py``
>> script from the ``utilities`` directory of your Zope 3 checkout:
>>
>> $ python utilities/i18nmergeall.py -l src/zope/app/locales
>>
>> So I tried that and found that in the 13 po files that are present,
>> over 80 thousand lines were changed (counting all lines in an svn
>> diff). Since the files combined have about 100 thousand lines, this
>> could be called a fairly big change. :)
>>
>> So: is there a reason this merging is not regularly done anymore? Or
>> can I just go ahead and submit those 80 thousand lines?
>
> It seems too big, that's weird.
> I think merging is not really done, and there are several changes to do
> f or i18n:
>
> - split the "zope" gettext domain into all the separate namespaces.
> Maybe only zope.app.* packages can be kept under the "zope.app" domain.

I think each and every package should have its own domain. Should we
just start with that for 3.5 packages? Would this break anything?

>
> - find a way to generate the .pot and .mo files at build. They should
> not be stored in the svn. We should only have the translated .po
> files, and the merging and compiling should be done during build.
> Maybe the .pot file could be a lso stored but this is not really
> necessary.

Yeah, the .mo files don't need to be stored indeed. But that's not
really high priority I think.

>
> - add an automatic test in each package to check whether the .po files
> ha ve been merged by the developer. If a po file is not in sync with
> the code, the t est fails. This would allow all the .po files to be
> always up to date.


Actually I don't really use the merge script. I prefere using somethink
like poedit and its "update from pot file" feature. This also tells me
what I have to translate and what is gone.




--
Christian Zagrodnick

gocept gmbh & co. kg · forsterstrasse 29 · 06112 halle/saale
www.gocept.com · fon. +49 345 12298894 · fax. +49 345 12298891



_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


plone at hannosch

Apr 30, 2008, 6:53 AM

Post #4 of 5 (262 views)
Permalink
Re: zope.app.locales i18nmergeall.py not used anymore? [In reply to]

Christophe Combelles wrote:
> I think merging is not really done, and there are several changes to do
> for i18n:
>
> - split the "zope" gettext domain into all the separate namespaces.
> Maybe only zope.app.* packages can be kept under the "zope.app" domain.

Just as a side note, I added a feature to zope.i18n a couple of days
ago, so it supports message catalogs in the same domain to be spread
across multiple packages. So there is no technical need to do the split
anymore. I guess the main argument here should be what works best for
the translators and how to make it easiest for them and attract new ones.

> - find a way to generate the .pot and .mo files at build. They should
> not be stored in the svn. We should only have the translated .po files,
> and the merging and compiling should be done during build. Maybe the
> .pot file could be also stored but this is not really necessary.

I added another feature where you can enable automatic compilation of mo
files from the po files during Zope startup. This is not ideal in all
cases but the underlying code should be easy to reuse to get this into
the build process as well.

Hanno

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )


dev at projekt01

Apr 30, 2008, 8:14 AM

Post #5 of 5 (263 views)
Permalink
AW: Re: zope.app.locales i18nmergeall.py not used anymore? [In reply to]

> Betreff: [Zope-dev] Re: zope.app.locales i18nmergeall.py not
> used anymore?

[...]

Just a sidenote,

I'm working on a z3c.recipe.i18n which allows to extract message ids
from egg packages. This will allow us to add a z3c.locales which uses a
recipe for extract all the message ids form the configured eggs.

I need this recipe for my own libraries. Because I use packages
like:

p01.foo
p01.bar

and like to provide a locales package like

p01.locales

> I think each and every package should have its own domain.
> Should we just start with that for 3.5 packages? Would this
> break anything?

I guess you are talking about the zope.* namespace, right?

I'll start adding a generic z3c.locales which allows us to
start translate all z3c.* packages which define the plain z3c as domain.

[...]

Regards
Roger Ineichen


> Christian Zagrodnick
>
> gocept gmbh & co. kg . forsterstrasse 29 . 06112
> halle/saale www.gocept.com . fon. +49 345 12298894 . fax. +49
> 345 12298891

_______________________________________________
Zope-Dev maillist - Zope-Dev[at]zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.