Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Users

Problems with i18n in Zope-2.12

 

 

Zope users RSS feed   Index | Next | Previous | View Threaded


krokodylek at tenbit

Apr 1, 2010, 3:20 PM

Post #1 of 1 (433 views)
Permalink
Problems with i18n in Zope-2.12

Hi :-)

I'm trying do develop a Zope-2.12 based application and I'm having problems
with internationalizing it... :-/

The *.po files are OK it seems, as translating in ZPTs with i18n:translate
works fine but I cannot get the translations to work in python code. How should
that be done? I'm only just learning development on Zope-2.12, but I have some
experience with Zope-2.10 and Plone-3

I've tried 2 approaches:

1. zope.i18nmessageid.MessageFactory, like this:

from zope.i18nmessageid import MessageFactory
_ = MessageFactory('MyDomain')
my_str = _(u'my_label', default=u'Some text')

This doesn't translate at all. my_str has 'my_label' value even though there
is a default value.


2. zope.i18n.translate, like this

from zope.i18n import translate
translate(u'my_label', 'MyDomain', default=u'Some text')

This only translates the msgid to English and I want it to translate to Polish
(I've tried in Polish version of Firefox, Konqueror and Arora).


What am I doing wrong? In the past I have used 1. in Plone-3 and it worked, so
what has changed? Or maybe I'm missing some package?

Also if someone could point me to some good resources about i18n, that would
be great.

I would be very grateful for any help or pointers.

Best regards,
MaciekZ
_______________________________________________
Zope maillist - Zope [at] zope
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )

Zope users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.