template_setup/15-Setting_locale.sh
deathbybandaid 13761d6c26 test
2023-04-05 13:38:14 -04:00

24 lines
640 B
Bash

#!/bin/bash
## Script Location
SCRIPTDIR=$(dirname $0)
source "$SCRIPTDIR/common/colors.sh"
source "$SCRIPTDIR/common/functions.sh"
source "$SCRIPTDIR/common/load-defaults.sh"
current_lang=$(locale | grep LANG= | cut -d= -f2)
printf "$COL_LIGHT_BLUE" "* locale is currently set to $current_lang"
if [ "$desired_locale" == "ask" ]; then
dpkg-reconfigure locales
else
update-locale "$desired_locale"
locale-gen --purge "$desired_locale"
dpkg-reconfigure --frontend noninteractive locales
. /etc/default/locale
fi
current_lang=$(locale | grep LANG= | cut -d= -f2)
printf "$COL_LIGHT_BLUE" "* locale is now set to $current_lang"