Internationalisation
Up to Zope 3
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
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
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!
if number == 1:
....size = _("1 reply"

else:
....size = _("${replies} replies"

....size.mapping = {'replies':`number`}
return size
Thank you, Philipp!
Powered by
Ploneboard

















