Re: i18ndude behaviour for "Default"
Vincent Fretin <[email protected]> Wed, 9 Feb 2011 14:32:02 +0100
| Newsgroups | gmane.comp.web.zope.plone.internationalization |
|---|---|
| Message-ID | <[email protected]> |
On Tue, Feb 8, 2011 at 11:13 AM, Françoise Conil <[email protected]> wrote: > 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. > Ok, why don't you remove the trailing whitespace in the template to fix the issue? 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 _______________________________________________ Plone-i18n mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/plone-i18n