Hi,

I need a vocabulary that presents i18n'd entries to the user.

That's not a problem, when only static data is used:

 from zope.app.i18n import MessageFactory
 _=MessageFactory('mpgsite')

 class MyVocabulary(SimpleVocabulary)
   def __init__(self):
      data={
         'foo':_(u'nice Foo'), 
         'bar':_(u'even better Bar')
      }
      terms=[SimpleTerm(short,title=title) for (short,title) in data.items()]
      SimpleVocabulary.__init__(self,terms)


The vocabulary's choices are i18n'd using the MessageFactory.
However, I need the vocabulary to be created from dynamic content like this:

 data={
    'foo':{
       'en':u"nice Foo",
       'de':u"schoener Foo"
    },
    'bar':{
       'en':u"even better Bar",
    }

How could I do this?

Regards,

Frank
       
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to