[Zope3-Users] Re: Can't find MessageIDFactory
Marius Gedminas
mgedmin at b4net.lt
Sun Feb 11 17:08:53 EST 2007
On Sun, Feb 11, 2007 at 11:00:51PM +1100, George Wright wrote:
>
> OnFri, 9 Feb 2007 20:59:07 -0500 Vinny wrote:
> >You'll need to use the newer boilerplate (I am running zope 3.3.0
> >FYI):
> >
> >from zope.i18n import MessageFactory
> >_ = MessageFactory("translationdomain")
> >
> >This can be found here:
> >
> >http://kpug.zwiki.org/WhatIsNewInZope33
> >
> >See section 7 Porting to Zope 3.3.0
> >
> >There is other useful information on how to deal with
> >the other areas of the book which are slightly out of
> >date as well.
>
> Thanks Vinny
> I used
> from zope.i18n import MessageFactory
> _ = MessageFactory("worldcookery")
>
> as suggested and made a bit of progress. Yet to work out necessary
> changes to the time_report.mapping['time_to_cook'] = 45
> line - but working on it.
This is what you need to do:
time_report = _(time_report, mapping={'time_to_cook': 45})
Or, if you have
time_report = _("your message here")
just above, condense them all to
time_report = _("Your message here",
mapping={'time_to_cook': 45,
'something_else': 'here'})
Marius Gedminas
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mail.zope.org/pipermail/zope3-users/attachments/20070212/6c4d0ced/attachment-0001.bin
More information about the Zope3-users
mailing list