nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nuxeo-localizer] Using Localizer in Python based Products for CMF


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] Using Localizer in Python based Products for CMF
Date: Wed, 17 Jul 2002 11:41:07 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Debian/1.0.0-1

Rainer Thaden wrote:

Hi,

 i developped some Python-based products for the CMF and want to have
 them in different languages. Since the CMF Localizer does not work
 with the new Localizer and the programmer apparently doesn't show up
 id decided to use the Localizer.
 I followed the example in the tutorial but soon came to a dead end.

 I looked a while through the sources and came to the following
 conclusions (please correct me if i'm wrong):

 Since i have my own edit-forms in the CMF, i have to write my own
 methods to add or edit properties.


I think so.


 Since i have only two languages to support, i would add the
 languages during the initialization of the product. I pass a tuple
 'languages' to the addMyProduct function. Can i just call
 'manage_addLanguage' with the tuple as parameter?


No, 'manage_addLanguage' expects a single language id as parameter,
an string, don't pass it a tuple. Instead:

 for language in languages:
     self.manage_addLanguage(language)


 How would i handle a form in which i could edit both languages ?
 Right now there is a param id, which names the property to edit and
 a lang which corresponds to the language. So it seems not to be
 possible to have properties in both languages in one form.

eehh.. are you talking about LocalContent objects, right?

With the LocalContent class (and any other LocalPropertyManager
subclass) you edit one property at a time, but all its language
versions, so you really are editing both languages at the same
time.


 By the way, there's a typo in LanguageManager.py in
 'manage_delLanguages'

   security.declareProtected('Manage languages', 'manage_addLanguage')
                                                         ^^^^
def manage_delLanguages(self, languages, REQUEST=None, RESPONSE=None): ^^^^
 Seems to be a typical 'copy and paste error' ;)

Thanks! it's fixed now.


--
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software





reply via email to

[Prev in Thread] Current Thread [Next in Thread]