1
0
mirror of https://github.com/zokradonh/kopano-docker.git synced 2026-08-22 22:03:03 +00:00

Store language (#251)

* clean out unneeded locales
* add test to verify that language is picked up in admin.cfg
* add basic question for language and use variable in compose
* use scriptlet to generate locales before start of kopano-server
* add script to check folders of a given mailbox (for language checks)
* add tests for locale generation

relates to #248
This commit is contained in:
Felix Bartels
2019-10-15 09:24:10 +02:00
committed by GitHub
parent cd74f245f1
commit c49da1d5eb
9 changed files with 196 additions and 7 deletions
+24
View File
@@ -42,6 +42,30 @@ fi
# start regular service
case "$SERVICE_TO_START" in
server)
# TODO this could check if the desired locale already exists before calling sed
KCCONF_ADMIN_DEFAULT_STORE_LOCALE=${KCCONF_ADMIN_DEFAULT_STORE_LOCALE:-"en_US.UTF-8"}
# get locales from env
# shellcheck disable=SC1004
sed --regexp-extended --expression='
1 {
i\
# This file lists locales that you wish to have built. You can find a list\
# of valid supported locales at /usr/share/i18n/SUPPORTED, and you can add\
# user defined locales to /usr/local/share/i18n/SUPPORTED. If you change\
# this file, you need to rerun locale-gen.\
\
}
/^('"$KCCONF_ADMIN_DEFAULT_STORE_LOCALE"')(_[[:upper:]]+)?(\.UTF-8)?(@[^[:space:]]+)?[[:space:]]+UTF-8$/! s/^/# /
' /usr/share/i18n/SUPPORTED > /etc/locale.gen
# make sure that en_US and de_DE are always there
sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen
dpkg-reconfigure --frontend=noninteractive locales
# determine db connection mode (unix vs. network socket)
if [ -n "$KCCONF_SERVER_MYSQL_SOCKET" ]; then
DB_CONN="file://$KCCONF_SERVER_MYSQL_SOCKET"