On Mon, Aug 25, 2008 at 8:51 PM, Steve McMahon <[EMAIL PROTECTED]> wrote:
> At the same level of specificity, the last rule wins (in CSS).
>
> On Mon, Aug 25, 2008 at 2:49 PM, Wichert Akkerman <[EMAIL PROTECTED]> wrote:
>>
>> Previously Alexander Limi wrote:
>> > On Mon, 25 Aug 2008 13:23:01 -0700, Wichert Akkerman
>> > <[EMAIL PROTECTED]> wrote:
>> >
>> > >It is similar to CSS !important rules: you can only override a rule
>> > > once.
>> > >The fact that an override is needed is argueably a design mistake
>> > >somewhere.
>> >
>> > …except for the fact that you can override as many times as you want in
>> > CSS. ;)
>>
>> Only by being more and more specific if I remember correctly?

Thanks a lot for the answers. I think I understood it better.

Going back to the original question. The adapter I was trying to override is:

   <adapter
       for="zope.publisher.interfaces.http.IHTTPRequest"
       provides="zope.i18n.interfaces.IUserPreferredLanguages"
       factory=.../>

IUserPreferredLanguages has a single method that returns a sequence
containing the preferred languages chosen by the user in his browser.
I want to replace this adapter in by an implementation that returns
always the same language, e.g: ["en-us"]. This way when a Plone Site
is created the initial content will be aways translated to "en-us",
even if the user has chosen "fr" as his preferred language in his
browser.

Question 1: what is the best way to achieve this behavior ? As I can't
override the adapter registration, I can think of two alternatives:
z3c.unconfigure and a monkey patch.

Question 2: where is this design wrong ? I mean, if I have to think
about overriding an override, use z3c.unconfigure or a monkey patch,
then something is wrong with this design. Or I'm missing something ...


Regards,
-- 
Rafael Bruno Cavalhero de Oliveira <[EMAIL PROTECTED]>
Analista de Sistemas - Paradigma <http://www.paradigma.com.br>
Mestrando em Ciência da Informação - UFMG
http://rafaelb.objectis.net

_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to