From 6bc93689b7214af69fdcf5106de9f8cc48824220 Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 29 Nov 2022 09:40:09 +0100 Subject: [PATCH] add locale selection on configure step --- usr/bin/archboot-setup.sh | 1 + usr/lib/archboot/installer/configuration.sh | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/usr/bin/archboot-setup.sh b/usr/bin/archboot-setup.sh index 8ba8f20c1..c7659aee8 100755 --- a/usr/bin/archboot-setup.sh +++ b/usr/bin/archboot-setup.sh @@ -102,6 +102,7 @@ configure_system() { ## END PREPROCESS ## geteditor || return 1 check_root_password || return 1 + set_locale || return 1 FILE="" S_CONFIG="" # main menu loop diff --git a/usr/lib/archboot/installer/configuration.sh b/usr/lib/archboot/installer/configuration.sh index 2bf83e048..02a0bba47 100644 --- a/usr/lib/archboot/installer/configuration.sh +++ b/usr/lib/archboot/installer/configuration.sh @@ -27,6 +27,20 @@ set_mkinitcpio() { } 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 #shellcheck disable=SC2013 for i in $(grep "^LANG" "${DESTDIR}"/etc/locale.conf | sed -e 's/.*=//g' -e's/\..*//g'); do