AW: [Zope-dev] Re: AW: Re: AW: Re: New i18n locale extraction concept

Jacob Holm jh at improva.dk
Fri May 9 04:59:33 EDT 2008


Hi,

Roger Ineichen wrote:
>>> Note, if you run the i18nextract script, all module must be there like in a running application. You can't only use the files which will 
>>> contain locales. Also modules which this packages import from must be there.
>>>       
>> That should not be necessary I think.  At least I am not used to it.
>> When I use i18ndude for making pot/po files for a Plone 
>> product/package and I have "from Products.CMFPlone import something"
>> in a file, then this import does not really take place.  I 
>> expect in the case of python files it simply looks for lines like:
>>
>>   _(u"My message to the world.")
>>     
>
> Probably it works in some ues case but for sure not in all.
> Let's give a sample. If you define a interface like
>
> foo = zope.schema.Choice(
>     title=_('Title'),
>     vocabulary=foo.bar.myVocabularyFromPackageFoo
>     )
>
>
> Then the foo.bar package must be available. 
>   
That sounds suspiciously like you are trying to import the 
modules/packages that you want to extract from. I think that is neither 
necessary nor desirable. The extraction should work on the source code 
only. For zcml extraction, that might be an issue because knowing which 
strings to extract requires processing the meta directives included from 
the file. For python source code and page templates there is no such 
problem.

Hope this helps,

Jacob




More information about the Zope-Dev mailing list