Re: i18ndude behaviour for "Default"

Vincent Fretin <[email protected]> Tue, 8 Feb 2011 09:55:25 +0100
Newsgroups gmane.comp.web.zope.plone.internationalization
Message-ID <[email protected]>
On Mon, Feb 7, 2011 at 4:28 PM, francoise <[email protected]> wrote:

>
> Hi all,
>
> I am building my .pot files with french "unaccented" msgid and french
> default strings. Then I will give .po file to someone who will be able to
> do
> a better english translation than me.
>
> I was wondering why I some Default string where extracted from Page
> Template
> while other were not :
>
>
> <h2><tal:block tal:content="p/libelle">Ingénieur</tal:block>
>    <tal:block tal:condition="python:p.position=='II'"
> i18n:translate="(confirme)">(confirmé)</tal:block>
>    <tal:block tal:condition="python:p.position=='III'"
> i18n:translate="(encadrement)">(encadrement)</tal:block>
> </h2>
>
>
> gave me the following .pot entries :
>
>
> #. Default: "(confirmé)"
> #: ./site/file1.pt:61
> msgid "(confirme)"
> msgstr ""
>
> #: ./site/file1.pt:62
> msgid "(encadrement)"
> msgstr ""
>
>
> I found the explanation in zope/tal/talgettext.py :
>
>
> class POEngine(DummyEngine):
>
>    def translate():
>        if msgid == default:
>           default = None
>
>
> So when msgid = default no "#.Default ..." is generated ?
>
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.


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

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

_______________________________________________
Plone-i18n mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plone-i18n