27 lines
784 B
Bash
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"
|