changeset 1435:17e40b5bf1df

reworked language list sorting
author Franz Pletz <fpletz AT franz-pletz DOT org>
date Mon, 21 Aug 2006 03:34:27 +0200
parents 7bfc51951aa5
children 738a61cfcc63
files MoinMoin/macro/AdvancedSearch.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/AdvancedSearch.py	Mon Aug 21 02:31:07 2006 +0200
+++ b/MoinMoin/macro/AdvancedSearch.py	Mon Aug 21 03:34:27 2006 +0200
@@ -55,12 +55,14 @@
     ])
 
     langs = dict([(lang, lmeta['x-language-in-english'])
-        for lang, lmeta in sorted(languages.items())])
+        for lang, lmeta in languages.items()])
+    userlang = macro.request.user.language or \
+            macro.request.cfg.language_default
     lang_dropdown = ''.join([
         u'<select name="language" size="1">',
         u'<option value="" selected>%s</option>' % _('any language'),
         ''.join(['<option value="%s">%s</option>' % lt for lt in
-            langs.items()]),
+            [(userlang, langs[userlang])] + sorted(langs.items())]),
         u'</select>',
     ])