added file dependency check, switched back to english, smaller fix and improvements

This commit is contained in:
fatalerrors
2021-11-18 14:53:11 +01:00
parent 9fc9b96165
commit b71a0c2ee8
21 changed files with 360 additions and 173 deletions

View File

@@ -24,15 +24,18 @@ export VER_conf_locale="0.1.2"
conf_locale()
{
pkginst locales locales-all
local gen_fname=/etc/locale.gen
backupdist $gen_fname
# Removing locales not in the list
prnt I "Désactivation des locales initiales..."
grep -v '^#' $gen_fname | grep -v -e '^[[:space:]]*$' |
while read -r line; do
sed -i "s/$line/# $line/" $gen_fname
done
prnt I "Deactivating initial locales from installation..."
if [[ $(grep -v '^#' $gen_fname | grep -v -e '^[[:space:]]*$') ]]; then
grep -v '^#' $gen_fname | grep -v -e '^[[:space:]]*$' |
while read -r line; do
sed -i "s/$line/# $line/" $gen_fname
done
fi
# Adding locales not yet enabled
for loc in $LOCALESET; do
@@ -42,10 +45,10 @@ conf_locale()
unset loc
unset gen_fname
prnt I "Régénération du cache de locale..."
prnt I "Regenerating locales cache..."
locale-gen
prnt I "Définition de la langue du systême..."
prnt I "Definingdsystem language..."
[[ ! $SYSLOCALE ]] &&
export SYSLOCALE=C
@@ -62,16 +65,16 @@ conf_locale()
precheck_conf_locale()
{
if [[ -z $LOCALESET ]]; then
prnt W "Aucune locale définie !"
prnt W "No locales definition!"
else
prnt m "Les locales disponibles seront : $LOCALESET"
prnt m "Available locales will be: $LOCALESET"
fi
if [[ -z $SYSLOCALE ]]; then
prnt W "Pas de locale systême définie, C sera utilié."
prnt W "No system locale defined, we'll use s."
export SYSLOCALE="C"
fi
prnt m "La locale par défaut sera : $SYSLOCALE"
prnt m "The default locale will be $SYSLOCALE"
}
export -f conf_locale