add locale selection on configure step

This commit is contained in:
Tobias Powalowski 2022-11-29 09:40:09 +01:00
parent 849b220f38
commit 6bc93689b7
2 changed files with 15 additions and 0 deletions

View file

@ -102,6 +102,7 @@ configure_system() {
## END PREPROCESS ## ## END PREPROCESS ##
geteditor || return 1 geteditor || return 1
check_root_password || return 1 check_root_password || return 1
set_locale || return 1
FILE="" FILE=""
S_CONFIG="" S_CONFIG=""
# main menu loop # main menu loop

View file

@ -27,6 +27,20 @@ set_mkinitcpio() {
} }
set_locale() { set_locale() {
if [[ ${SET_LOCALE} == "" ]]; then
LOCALES="en_US English de_DE German es_ES Spanish fr_FR French pt_PT Portuguese ru_RU Russian OTHER More"
OTHER_LOCALES="$(grep 'UTF' ${DESTDIR}/etc/locale.gen | sed -e 's:#::g' -e 's: UTF-8.*$::g')"
#shellcheck disable=SC2086
DIALOG --menu "Select A Locale:" 14 30 8 ${LOCALES} 2>${ANSWER} || return 1
set_locale=$(cat ${ANSWER})
if [[ "${set_locale}" == "OTHER" ]]; then
#shellcheck disable=SC2086
DIALOG --menu "Select A Locale:" 18 30 12 ${OTHER_LOCALES} 2>${ANSWER} || return 1
set_locale=$(cat ${ANSWER})
fi
sed -i -e "s#LANG=.*#LANG=${set_locale}#g" "${DESTDIR}"/etc/locale.conf
SET_LOCALE="1"
fi
# enable glibc locales from locale.conf # enable glibc locales from locale.conf
#shellcheck disable=SC2013 #shellcheck disable=SC2013
for i in $(grep "^LANG" "${DESTDIR}"/etc/locale.conf | sed -e 's/.*=//g' -e's/\..*//g'); do for i in $(grep "^LANG" "${DESTDIR}"/etc/locale.conf | sed -e 's/.*=//g' -e's/\..*//g'); do