5 . /usr/share/debconf/confmodule
7 db_input medium roundcube/hosts || true
10 # Retrieve all available languages
11 instd_langs=$(echo /usr/share/roundcube/program/localization/*/messages.inc | \
12 sed 's+[^ ]*/\([^ ]*\)/messages.inc+\1,+g' | sed 's+,$++')
13 db_subst roundcube/language languages $instd_langs
14 # First try to get the current choice in case of preseeding or if the
15 # question has already been asked
16 db_get roundcube/language || true
18 if [ -n "$locale" -a -d "/usr/share/roundcube/program/localization/$locale" ]; then
19 # We get our answer (db_set should be useless in fact)
20 db_set roundcube/language $locale
22 # Either we never answered the question or the locale does not
23 # exist any more. In both cases, we do as if we never seen the
25 db_fset roundcube/language seen false
26 # Try to guess the locale
27 locale=$(echo $LANG | sed 's/[@\.].*//')
28 if [ -d /usr/share/roundcube/program/localization/$locale ]; then
29 db_set roundcube/language $locale
31 locale=$(echo $locale | sed 's/_.*//')
32 if [ -d /usr/share/roundcube/program/localization/$locale ]; then
33 db_set roundcube/language $locale
35 db_set roundcube/language en_US
40 db_input medium roundcube/language || true
43 if [ -f /usr/share/dbconfig-common/dpkg/config ]; then
44 dbc_dbtypes="mysql, pgsql, sqlite"
45 dbc_authmethod_user="password"
46 . /usr/share/dbconfig-common/dpkg/config
50 db_input medium roundcube/reconfigure-webserver || true
52 db_input medium roundcube/restart-webserver || true