[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nuxeo-localizer] Two Localizer sites
From: |
Juan David Ibáñez Palomar |
Subject: |
Re: [Nuxeo-localizer] Two Localizer sites |
Date: |
Thu, 07 Nov 2002 17:09:38 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020913 Debian/1.1-1 |
Garikoitz Araolaza wrote:
Hi!
Here I am again with my strange questions... ;-)
I'm trying to work with 2 Localizer instances in one site.
I see, breaking the "rules" :-)
The Tourist information part of the site must be multilingual ( 5 or 6
languages), so I added a new Localizer inside the touristic folder:
Main_Folder
Localizer (bilingual)
Folder_1
LocalContent_1
LocalContent_2
LocalContent_3
Folder_2
Folder_3
TouristFolder
Localizer ( 6 languages )
LocalContent_4
LocalContent_5
LocalContent_6
I have an accept_language editing PyScript inside each Localizer and
they are added in the accept_method token property.
So, what I'm seeing is that both methods (in both Localizer instances)
are being executed, but I just want the method in the first Localizer
to be executed.
Is there any way to use only the first Localizer and not the second one?
If you access /Main_Folder/TouristFolder/LocalContent_4 first
the accept_method from the "bilingual" Localizer will be run,
then the one from the "6 languages" Localizer.
What you should do is to manually prevent the execution of the
bilingual one. For example, add a property to TouristFolder
named "i_am_a_tourist", then the code of the accept_method from
the "bilingual" Localizer will be:
i_am_a_tourist = getattr(context, 'i_am_a_tourist', None)
if i_am_a_tourist is None:
# change accept_languages man
That is, use acquisition.
Regards,
--
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software