Zope Zone Navigation
 
Document Actions

Internationalisation

Up to Zope 3

Internationalisation

Posted by Marcus Ertl at January 07. 2004
Hi!

Im just playing around with i18nextract.py, it works fine, but it
doesn't extract the string needed im mi ISized-adapter!

What's wrong with folling code (part's that don't other are removed):


from zope.i18n import MessageIDFactory
_ = MessageIDFactory('lwproducts')

class MessageSized:

implements(ISized)

def sizeForDisplay(self):
'See ISized'
[...]
if number == 1:
size = "1 reply"
else:
size = "${replies} replies"
size = _(size)
size.mapping = {'replies':`number`}
return size

(Sorry, the forum kills all indents!)

Thank you very much!

Bye
Marcus

Internationalisation

Posted by Marcus Ertl at January 08. 2004
The example with the ISized?-adapter did not work for me. But Philipp von Weitershausen told me, how it would work::

if number == 1:
....size = _("1 reply";)
else:
....size = _("${replies} replies";)
....size.mapping = {'replies':`number`}
return size

Thank you, Philipp!

Internationalisation

Posted by Jake at January 12. 2004
Hello... yeah the forums (ZUBB) is not great for code.

Of course, I know the write of the software (me) so I am might be able to work it into the next release... :)

Jake
Powered by Ploneboard
 

Home Discussions Zope 3 Internationalisation