[Zope-dev] zope.app.locales i18nmergeall.py not used anymore?

Christophe Combelles ccomb at free.fr
Sat Apr 26 04:25:16 EDT 2008


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,
> 



More information about the Zope-Dev mailing list