[Zope3-dev] Re: Internationalisation
Philipp von Weitershausen
philipp at weitershausen.de
Thu Jan 8 05:28:02 EST 2004
Marcus,
> from zope.i18n import MessageIDFactory
> _ = MessageIDFactory('lwproducts')
>
> class MessageSized:
>
> implements(ISized)
>
> def sizeForDisplay(self):
> 'See ISized'
> [...]
> if number == 1:
> size = "1 reply"
size = _("1 reply")
> else:
> size = "${replies} replies"
size = _("${replies} replies")
size.mapping = {'replies':`number`}
return size
More information about the Zope3-dev
mailing list