summaryrefslogtreecommitdiff
path: root/install
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-03-08 10:50:46 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-06-17 13:21:27 +0200
commit68a064fde171c99066e3a3470a98ca3ed39bce5a (patch)
tree2c93553a9072a6e0156a7e81d3a9fc8d8c51163f /install
parent663b1610fbb8483a787883eb0efeec09323ab074 (diff)
downloadIshtar-68a064fde171c99066e3a3470a98ca3ed39bce5a.tar.bz2
Ishtar-68a064fde171c99066e3a3470a98ca3ed39bce5a.zip
Isntall script: manage locale
Diffstat (limited to 'install')
-rwxr-xr-xinstall/ishtar-install28
-rwxr-xr-xinstall/ishtar-prepare-instance14
2 files changed, 35 insertions, 7 deletions
diff --git a/install/ishtar-install b/install/ishtar-install
index 9b9fd6c4b..40cfd2d3e 100755
--- a/install/ishtar-install
+++ b/install/ishtar-install
@@ -249,6 +249,24 @@ EOF
exit 1
fi
+ current_locale=''
+ cat >&2 <<-'EOF'
+
+-------------------------------------------------------------------------------
+ A default locale have to be set for document generation. This locale will be
+ used system wide. For instance for a french installation choose: fr_FR.
+
+EOF
+ while [ "$current_locale" == '' ]
+ do
+ cecho y "* Which locale do you want to use? [en_US]"
+ read choice
+ if [ -z "$choice" ]; then
+ current_locale='en_US'
+ else
+ current_locale=$choice
+ fi
+ done
install_path=''
cat >&2 <<-'EOF'
@@ -319,6 +337,15 @@ EOF
fi
echo ""
+ cecho y "Configure locale"
+ echo ""
+
+ apt-get install -y locales && \
+ sed -i -e "s/# $current_locale.*/$current_locale.UTF-8 UTF-8/" /etc/locale.gen && \
+ dpkg-reconfigure --frontend=noninteractive locales && \
+ update-locale LANG=$LANG
+
+ echo ""
cecho y "Install cron script"
echo ""
@@ -481,6 +508,7 @@ EOF
echo "ISHTAR_PATH="$full_install_path > $etc_path"config"
echo "ISHTAR_DB="$default_db >> $etc_path"config"
echo "ISHTAR_WEBSERVER="$webserver >> $etc_path"config"
+ echo "ISHTAR_LOCALE="$current_locale >> $etc_path"config"
echo "# settings added to all instances" >> $etc_path"extra_settings.py"
echo ""
cecho g "*******************************************************************************"
diff --git a/install/ishtar-prepare-instance b/install/ishtar-prepare-instance
index fec08b119..4bdafd122 100755
--- a/install/ishtar-prepare-instance
+++ b/install/ishtar-prepare-instance
@@ -51,13 +51,6 @@ do_install_instance() {
fi
fi
- export LANG=fr_FR.UTF-8
- if [ "$(locale 2>&1 >/dev/null|wc -l)" != 0 ]; then
- cecho r "Unable to set LANG=$LANG properly"
- cecho "Try: 'dpkg-reconfigure locales' or install the 'locales-all' package"
- exit 1
- fi
-
if [ ! -z '$CONFIG_PATH' ]; then
CONFIG_PATH="/etc/ishtar/"
fi
@@ -73,6 +66,13 @@ do_install_instance() {
source $CONFIG_PATH/config
+ export LANG=$ISHTAR_LOCALE.UTF-8
+ if [ "$(locale 2>&1 >/dev/null|wc -l)" != 0 ]; then
+ cecho r "Unable to set LANG=$LANG properly"
+ cecho "Try: 'dpkg-reconfigure locales' or install the 'locales-all' package"
+ exit 1
+ fi
+
cd $ISHTAR_PATH
INSTANCES_FILE=$CONFIG_PATH/instances