Compare commits
4 commits
90eb95f28b
...
aac5ad09d8
Author | SHA1 | Date | |
---|---|---|---|
aac5ad09d8 | |||
b7e816b1a6 | |||
450cdea46a | |||
ad043c978b |
1 changed files with 39 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue