From: Vincent Bernat Date: Sat, 19 Apr 2008 14:55:46 +0000 (+0000) Subject: Allow to preseed language value (Closes: #476803). X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2289336aaeacfa3e785735d403bc667c5cc56566;p=roundcube.git Allow to preseed language value (Closes: #476803). --- diff --git a/debian/changelog b/debian/changelog index 3b26f17..34e5dac 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 15 Apr 2008 08:20:47 +0200 + -- Vincent Bernat Sat, 19 Apr 2008 16:50:28 +0200 roundcube (0.1.1-1) unstable; urgency=low diff --git a/debian/roundcube-core.config b/debian/roundcube-core.config index c5ef209..c85dc70 100644 --- a/debian/roundcube-core.config +++ b/debian/roundcube-core.config @@ -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