Petri Savolainen wrote:
> This used to work:
>
> from Products.PlacelessTranslationService.MessageID
import MessageIDFactory
>
> However now (Plone 2.1.2) it seems to fail. What is the
"new way" of
> doing this? I tried plone.org & google but did not
find anything- hope I
> did not miss something obvious
>
> I see that context.translate can be used but it annoys
the heck out of
> me having to declare translation domain in every
call...
I removed the MessageID support from
PlacelessTranslationService as it
is available from Zope3/Five directly these days and frankly
didn't knew
of anyone using the one in PTS.
For Zope 2.8 it's:
from zope.i18nmessageid import MessageIDFactory
msg_factory = MessageIDFactory('yourproduct')
Which is deprecated and starting with Zope 2.9 will become:
from zope.i18nmessageid import MessageFactory
msg_factory = MessageFactory('yourproduct')
You might want to read http://pl
one.org/products/plone/roadmap/108 for
the details about how we use this in Plone 2.5 and
http://svn.zope.org/Zope3/
branches/3.2/src/zope/i18nmessageid/messages.txt?view=markup
for some background information on the semantic differences
and API
changes between MessageID's and Messages.
For Plone 2.1 the easiest way is to use an older
PlacelessTranslationService (<= 1.2.5) though. I was
pretty sure that
using MessageID's in Plone 2.1 wouldn't work in most cases
as the
translation_service tool isn't aware of them and Archetypes
has some
pitfalls, which I both fixed for Plone 2.5/Archetypes 1.4,
but you seem
to prove me wrong ;)
If none of the above work out for you, drop me a line and
I'll put the
MessageID stuff back in PTS for Plone 2.1. As the next
bug-fix release
(2.1.3) is pretty close, you might want to hurry in this
case.
Sorry for the trouble and best wishes,
Hanno
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking
scripting language
that extends applications into web and mobile media. Attend
the live webcast
and join the prime developer group breaking into this new
coding territory!
http://sel.as-us.falkag.net/
sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Plone-i18n mailing list
Plone-i18n lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-i18n
a>
|