nuxeo-localizer
[Top][All Lists]
Advanced

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

Re: [Nuxeo-localizer] possitive discrimination of a given language


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] possitive discrimination of a given language
Date: Thu, 28 Feb 2002 16:01:15 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.8) Gecko/20020214

Juan David Ibáñez Palomar wrote:

Luistxo Fernandez wrote:

David:

Another advantage (for you) to moving to the CVS is that it gives you more
power to change "USER_PREF_LANGUAGES", so you'll be able to implement,
for example "possitive discrimination of a given language".


Now, that´s what a customer demanded us for an ongoing project.

Languages for the site: Spanish (es) / Basque (eu).

It´s a site about Basque-language promotion. It happens that many Basque users just get customised PCs out of the shop with a spanish-configured browser (marketing options go that way around here). Then it would happen that many users would find Spanish first... Not very elegant, given the site´s nature.

Dirty solution that we found: The locales for Localizer will be Irish (ga) and Basque (eu, set as default). And (ga) will be disguised as Spanish... So, everybody will get Basque first, except people with browsers configured for Irish, who will get a Spanish version.

Disclaimer: Our choice for Irish has nothing to do with Gaelic.. It´s just that its ISO 2-letter code 'ga' fits somehow with the Basque name of the Spanish language ('Gaztelania').

Luistxo


Yes, it's a bit dirty. With the CVS version you would do:

1. Install a Localizer instance in the root of your web site.

Reminder, from now the Localizer meta type will be used for language
negotiation purposes only.

2. Add a Python script to the Localizer object named, for example,
"accept_basque", it will receive one parameter: "accept_language".
The script will contain one line: "accept_language.set('ba', 5.0)"


I mean: "accept_language.set('eu', 5.0)"



3. Change the property "accept_methods" of the Localizer object,
add "accept_basque" to the list.

That's all.

This way you change the "USER_PREF_LANGUAGES" variable to
give to the Basque language the highest priority.




--
J. David Ib??ez, Nuxeo.com
Libre Software zealot (http://www.fsf.org)






reply via email to

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