[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nuxeo-localizer] Ordering languages
From: |
Juan David Ibáñez Palomar |
Subject: |
Re: [Nuxeo-localizer] Ordering languages |
Date: |
Wed, 19 Jun 2002 00:54:55 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Debian/1.0.0-1 |
Garikoitz Araolaza wrote:
After creating one hundred LocalContent objects, I noticed that some
of them have a given language order (en es fr for example) and some of
them a diferent one ( es en fr for example) as a result of
Copying/Pasting from different models.
So, as
<dtml-in "Localizer.get_languages_map()" mapping>
returns the languages, ordered by the actual Localizer object, it
happens that the language order differs in the same site.
My question is:
Is there any way to sort the languages in all Localizer objects in a
site with a given order? I wish I could write a simple Python Script
to apply it to all the objects. ;-)
Yes, that's my suggestion, something like:
langs = Localizer.get_languages_map()
langs.sort(lambda x,y: cmp(x['id'], y['id']))
return langs
And then add it to your FAQ ;-)
Note that everything you put in the FAQ is not going to be forgetted,
I will read it sometime in the future and see how to improve Localizer
to make these tasks easier.
--
J. David Ibáñez, Nuxeo.com
Libre Software zealot (http://www.fsf.org)