]> git.donarmstrong.com Git - roundcube.git/commitdiff
Allow to preseed language value (Closes: #476803).
authorVincent Bernat <bernat@luffy.cx>
Sat, 19 Apr 2008 14:55:46 +0000 (14:55 +0000)
committerJérémy Bobbio <lunar@debian.org>
Sat, 18 Jun 2011 17:26:02 +0000 (19:26 +0200)
debian/changelog
debian/roundcube-core.config

index 3b26f173f4817ee788d2b977f346660570ffb444..34e5dac0ecfb65cc9761df14d9ced0f60bb86525 100644 (file)
@@ -2,8 +2,9 @@ roundcube (0.1.1-2) unstable; urgency=low
 
   * Comment by default Alias directive for tinymce in Apache configuration
     file (Closes: #476162).
+  * Allow to preseed language value (Closes: #476803).
 
- -- Vincent Bernat <bernat@luffy.cx>  Tue, 15 Apr 2008 08:20:47 +0200
+ -- Vincent Bernat <bernat@luffy.cx>  Sat, 19 Apr 2008 16:50:28 +0200
 
 roundcube (0.1.1-1) unstable; urgency=low
 
index c5ef209aa49f1eaa9d1864cebca781df8ee1820b..c85dc7024da11db032e7dbff1dbe18af958fe1bb 100644 (file)
@@ -15,17 +15,24 @@ db_metaget roundcube/language languages && oldchoices="$RET"
 if [ ! "$oldchoices" ] || [ "$instd_langs" != "$oldchoices" ]; then
        db_subst roundcube/language languages $instd_langs
        db_fset roundcube/language seen false
-       # Try to guess the locale
-       locale=$(echo $LANG | sed 's/[@\.].*//')
-       if [ -d /usr/share/roundcube/program/localization/$locale ]; then
+       # Firs try to get the current choice in case of preseeding
+       db_get roundcube/language || true
+       locale="$RET"
+       if [ -n $locale -a -d /usr/share/roundcube/program/localization/$locale ]; then
           db_set roundcube/language $locale
        else
-          locale=$(echo $locale | sed 's/_.*//')
-          if [ -d /usr/share/roundcube/program/localization/$locale ]; then
-              db_set roundcube/language $locale
-          else
-              db_set roundcube/language en_US
-          fi
+              # Try to guess the locale
+              locale=$(echo $LANG | sed 's/[@\.].*//')
+              if [ -d /usr/share/roundcube/program/localization/$locale ]; then
+                             db_set roundcube/language $locale
+             else
+                     locale=$(echo $locale | sed 's/_.*//')
+                     if [ -d /usr/share/roundcube/program/localization/$locale ]; then
+                             db_set roundcube/language $locale
+                     else
+                             db_set roundcube/language en_US
+                     fi
+             fi
        fi
 fi
 # Ask the question