From c0479cffdeb96bdea59b9fd0058420d92ea48613 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 9 Oct 2016 22:42:59 +0100 Subject: [PATCH] Language setting --- src/freedombone-config | 1 + src/freedombone-utils-international | 33 +++++++++++++++-------------- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/freedombone-config b/src/freedombone-config index bbd3c7be..69756a76 100755 --- a/src/freedombone-config +++ b/src/freedombone-config @@ -1280,6 +1280,7 @@ function interactive_select_language { esac save_configuration_values + locale-gen "${DEFAULT_LANGUAGE}" update-locale LANG=${DEFAULT_LANGUAGE} update-locale LANGUAGE=${DEFAULT_LANGUAGE} update-locale LC_MESSAGES=${DEFAULT_LANGUAGE} diff --git a/src/freedombone-utils-international b/src/freedombone-utils-international index e3458bcc..bf56b55b 100755 --- a/src/freedombone-utils-international +++ b/src/freedombone-utils-international @@ -29,26 +29,27 @@ # along with this program. If not, see . function locale_setup { - if grep -Fxq "locale_setup" $COMPLETION_FILE; then - return - fi + if grep -Fxq "locale_setup" $COMPLETION_FILE; then + return + fi - apt-get -y install locales locales-all debconf + apt-get -y install locales locales-all debconf - if [ ! "$DEFAULT_LANGUAGE" ]; then - DEFAULT_LANGUAGE='en_GB.UTF-8' - fi - if [ ${#DEFAULT_LANGUAGE} -lt 2 ]; then - DEFAULT_LANGUAGE='en_GB.UTF-8' - fi + if [ ! "$DEFAULT_LANGUAGE" ]; then + DEFAULT_LANGUAGE='en_GB.UTF-8' + fi + if [ ${#DEFAULT_LANGUAGE} -lt 2 ]; then + DEFAULT_LANGUAGE='en_GB.UTF-8' + fi - update-locale LANG=${DEFAULT_LANGUAGE} - update-locale LANGUAGE=${DEFAULT_LANGUAGE} - update-locale LC_MESSAGES=${DEFAULT_LANGUAGE} - update-locale LC_ALL=${DEFAULT_LANGUAGE} - update-locale LC_CTYPE=${DEFAULT_LANGUAGE} + locale-gen "${DEFAULT_LANGUAGE}" + update-locale LANG=${DEFAULT_LANGUAGE} + update-locale LANGUAGE=${DEFAULT_LANGUAGE} + update-locale LC_MESSAGES=${DEFAULT_LANGUAGE} + update-locale LC_ALL=${DEFAULT_LANGUAGE} + update-locale LC_CTYPE=${DEFAULT_LANGUAGE} - echo 'locale_setup' >> $COMPLETION_FILE + echo 'locale_setup' >> $COMPLETION_FILE } # NOTE: deliberately no exit 0