template_setup/15-Setting_locale.sh
deathbybandaid 3916321a9b test
2023-04-05 13:51:16 -04:00

27 lines
784 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
sudo update-locale "LANG=$desired_locale"
sudo locale-gen --purge "$desired_locale"
sudo dpkg-reconfigure --frontend noninteractive locales
# echo "LANG=$desired_locale" | sudo tee -a /etc/locale.gen
sudo locale-gen
sudo update-locale "LANG=$desired_locale"
. /etc/default/locale
fi
current_lang=$(locale | grep LANG= | cut -d= -f2)
printf "$COL_LIGHT_BLUE" "* locale is now set to $current_lang"