Re: i18ndude behaviour for "Default"

Françoise Conil <[email protected]> Tue, 8 Feb 2011 11:13:11 +0100
Newsgroups gmane.comp.web.zope.plone.internationalization
Message-ID <[email protected]>
2011/2/8 Vincent Fretin <[email protected]>:
> On Mon, Feb 7, 2011 at 4:28 PM, francoise <[email protected]> wrote:
>
> Hi,
>
> That's right and this is not a problem. Why give the information twice? One
> is enough.
> Default in po files are actually comment, it's not used at all by the
> translation engine, the default from the template yes.
>
Hi Vincent,

I justed searched why some defaults string were inserted in .po files
and others did not.

>>
>> I had a problem with "default normalization" : for Page Templates,
>> zope/tal/talinterpreter.py normalize() is called for "Default" so : "  a
>> b
>> " becomes "a b".
>
> I didn't understand you here.
>
>>
>> For strings extracted from python code the same normalization does not
>> seem
>> to be applied. This leads to different defaults for the same default
>> string.
>
> Please give an example.

You may have the following code in a page template :
       <span i18n:translate="Date de depart prevue : ">Date de départ
prévue : </span>

and this one in a python script :
      context.translate(_(u"Date de depart prevue : ",default=u"Date
de départ prévue : ",domain="mysite"))

The default extracted from the page template will remove leading and
trailing whitespace but the default extracted from the script will not
remove those whitespace. This will comme to an error telling there is
different default for the msgid.

Thanks
Françoise

>
> Regards
> Vincent
>
>

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb