From ad043c978bb6383c5dadcf82bddc9e0d76d15058 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 30 Aug 2024 17:49:48 +0200 Subject: [PATCH] install locales --- spcd/bootstrap.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 3ac96f9..16635a4 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -1158,6 +1158,34 @@ spcd_step__packages_verify_https() { fi } +spcd_step__packages_install_locales() { + spcd_step "Install locales" + case "${SPCD_PM}" in + "${SPCD_PM_APK}") spcd_install_package "musl-locales" ;; + "${SPCD_PM_APT}") + unset spcd_step__pil__text + for spcd_step__pil__locale in "${@}"; do + spcd_step__pil__text="${spcd_step__pil__text}\ +${spcd_step__pil__locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET} +" + done + spcd_os_write "/etc/locale.gen" "${spcd_step__pil__text}" + spcd_install_package "locales" + ;; + "${SPCD_PM_DNF}") + for spcd_step__pil__locale in "${@}"; do + spcd_step__pil__lang="$( + echo "${spcd_step__pil__locale}" | cut -d _ -f 2 + )" + spcd_install_package "glibc-langpack-${spcd_step__pil__lang}" + done + ;; + "${SPCD_PM_PACMAN}") spcd_install_package "glibc-locales" ;; + "${SPCD_PM_ZYPPER}") spcd_install_package "glibc-locale" ;; + *) ;; + esac +} + spcd_step__packages_upgrade_system() { spcd_step "Upgrade system" case "${SPCD_PM}" in @@ -1352,6 +1380,9 @@ ${SPCD_PYTHON_ALIAS} / ${spcd_stp__name}" # ╰──────╯ spcd_main() { + set -- \ + "${_SPCD_TXT_LANGUAGE_ENGLISH}" \ + "${_SPCD_TXT_LANGUAGE_FRENCH}" # environment spcd_txt_locale # @@ -1385,6 +1416,7 @@ spcd_main() { # packages spcd_step_in "Packages" spcd_step__packages_verify_https + spcd_step__packages_install_locales "${@}" spcd_step__packages_update_catalog spcd_step__packages_upgrade_system spcd_step__packages_install_dos2unix