Compare commits

...

4 commits

Author SHA1 Message Date
aac5ad09d8
fix/lang,locale
Some checks failed
/ arch (push) Successful in 2m37s
/ alpine (push) Successful in 1m52s
/ fedora (push) Successful in 12m14s
/ opensuse (push) Successful in 3m22s
/ alma (push) Successful in 12m35s
/ rocky (push) Successful in 12m37s
/ ubuntu (push) Successful in 7m19s
/ debian (push) Failing after 3m34s
2024-08-30 21:56:31 +02:00
b7e816b1a6
mv 2024-08-30 21:44:37 +02:00
450cdea46a
txt/_ 2024-08-30 18:08:11 +02:00
ad043c978b
install locales 2024-08-30 17:49:48 +02:00

View file

@ -178,13 +178,11 @@ _spcd_step_wipe() {
_SPCD_TXT_CHARSET="UTF-8"
_SPCD_TXT_LANGUAGE_DEFAULT="C"
_SPCD_TXT_LANGUAGE_ENGLISH="en_US"
_SPCD_TXT_LANGUAGE_FRENCH="fr_FR"
_spcd_txt_pick() {
case "${SPCD_TXT_LANGUAGE}" in
"${_SPCD_TXT_LANGUAGE_ENGLISH}") echo "${1}" ;;
"${_SPCD_TXT_LANGUAGE_FRENCH}") echo "${2}" ;;
"${SPCD_TXT_LANGUAGE_ENGLISH}") echo "${1}" ;;
"${SPCD_TXT_LANGUAGE_FRENCH}") echo "${2}" ;;
*) ;;
esac
}
@ -324,6 +322,9 @@ spcd_step_out() {
# │ functions │ txt │
# ╰───────────┴─────╯
SPCD_TXT_LANGUAGE_ENGLISH="en_US"
SPCD_TXT_LANGUAGE_FRENCH="fr_FR"
spcd_txt_get() {
case "${1}" in
"set") _spcd_txt_pick "Set" "Définir" ;;
@ -432,7 +433,7 @@ spcd_step__environment_defaults_set() {
[ -n "${SPCD_REF_STAGING}" ] || SPCD_REF_STAGING="dev"
[ -n "${SPCD_TXT_LANGUAGE}" ] ||
SPCD_TXT_LANGUAGE="${_SPCD_TXT_LANGUAGE_ENGLISH}"
SPCD_TXT_LANGUAGE="${SPCD_TXT_LANGUAGE_ENGLISH}"
[ -n "${SPCD_URL_ALMA}" ] ||
# /almalinux/$releasever/…
@ -1158,6 +1159,38 @@ spcd_step__packages_verify_https() {
fi
}
spcd_step__packages_install_locales() {
spcd_step "Install locales"
set -- \
"${SPCD_TXT_LANGUAGE_ENGLISH}" \
"${SPCD_TXT_LANGUAGE_FRENCH}"
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 1
)"
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_txt_locale "${SPCD_TXT_LANGUAGE}"
}
spcd_step__packages_upgrade_system() {
spcd_step "Upgrade system"
case "${SPCD_PM}" in
@ -1385,6 +1418,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