[Zope-dev] Re: [Checkins] SVN: zope.i18n/branches/regebro-pluralsupport/src/zope/i18n/ Changed the API. It's unwieldy as it is, so better have separate methods

Lennart Regebro regebro at gmail.com
Wed Jul 16 17:27:34 EDT 2008


On Wed, Jul 16, 2008 at 20:55, Stephan Richter
<srichter at cosmos.phy.tufts.edu> wrote:
> Good question! The ZPT above is not correct; once we write a correct one, it
> becomes more obvious:
>
> <p i18n:translate="">There are <span tal:content="view/num" i18n:name="num"
> i18n:count="view/num>10</span> files.</p>

Ah, well, right. Of course all the examples you a %d substitution, but
I just realized that gettext in itself does no substituation at all,
so this is better. We should use the standard ${name} substitution for
this too. However, you can't have more than one number per message, so

<p i18n:translate="">There are <span tal:content="view/num"
i18n:name="num"  i18n:count="view/num>10</span> files and <span
tal:content="view/num" i18n:name="num"
i18n:count="view/dirs>10</span>directories.</p>

wouldn't make any sense. Which number should be used? So I actually
think i18n:count still should be on the main tag.

> Alternatively we could just evaluate the tal:content or tal:replace
> expression.

But then we wouldn't know if we have a plural substitution or not, and
we would have to start guessing...

-- 
Lennart Regebro: Zope and Plone consulting.
http://www.colliberty.com/
+33 661 58 14 64


More information about the Zope-Dev mailing list