[SCM] GUI front-end for Debian Live. branch, master, updated. aed7233549fc5cbaae976ac299dea898e251f0c6

Chris Lamb chris at chris-lamb.co.uk
Tue Aug 12 00:55:29 UTC 2008


The following commit has been merged in the master branch:
commit aed7233549fc5cbaae976ac299dea898e251f0c6
Author: Chris Lamb <chris at chris-lamb.co.uk>
Date:   Tue Aug 12 01:34:49 2008 +0100

    Make locale parsing fuzzier
    
    Signed-off-by: Chris Lamb <chris at chris-lamb.co.uk>

diff --git a/LiveMagic/views/wizard.py b/LiveMagic/views/wizard.py
index cbe233b..c6c64e6 100644
--- a/LiveMagic/views/wizard.py
+++ b/LiveMagic/views/wizard.py
@@ -101,9 +101,17 @@ class WizardView(object):
         c = self['combo_locale']
         c.set_active(0)
         match = os.environ.get('LANG', 'en_US.UTF-8')
+        found = False
         for idx, locale in enumerate(self.controller.get_locales()):
             c.append_text(locale)
-            if locale == match:
+
+            if found:
+                continue
+
+            if locale.replace('-', '_') == match.replace('-', '_'):
+                c.set_active(idx)
+                found = True
+            elif match.startswith(locale):
                 c.set_active(idx)
 
         c = self['combo_keyboard']

-- 
GUI front-end for Debian Live.



More information about the debian-live-changes mailing list