This commit is contained in:
Marc Beninca 2024-09-04 14:44:39 +02:00
parent 44f68bcca2
commit dc51f1eba6
Signed by: marc.beninca
GPG key ID: 9C7613450C80C24F

View file

@ -377,48 +377,6 @@ spcd_txt_get() {
esac esac
} }
spcd_txt_locales_echo() {
spcd_os_printenv "LANGUAGE"
locale --all-locales
}
spcd_txt_locales() {
set -- \
"${SPCD_TXT_LOCALE_ENGLISH}" \
"${SPCD_TXT_LOCALE_FRENCH}"
local language locale text
spcd_txt_locales_echo
spcd_split
for locale in "${@}"; do
case "${1}" in
"glibc-langpack-")
language="$(echo "${locale}" | cut -d _ -f 1)"
spcd_install_package "glibc-langpack-${language}"
;;
"LANGUAGE")
if [ -n "${text}" ]; then
text="${text}:${locale}"
else
text="${locale}"
fi
;;
"locale.gen")
text="${text}\
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
"
;;
*) ;;
esac
done
case "${1}" in
"LANGUAGE") export LANGUAGE="${text}" ;;
"locale.gen") spcd_os_write "/etc/locale.gen" "${text}" ;;
*) ;;
esac
spcd_split
spcd_txt_locales_echo
}
# ╭──────╮ # ╭──────╮
# │ step │ # │ step │
# ╰──────╯ # ╰──────╯
@ -961,6 +919,48 @@ spcd_txt_locale() {
esac esac
} }
spcd_txt_locales_echo() {
spcd_os_printenv "LANGUAGE"
locale --all-locales
}
spcd_txt_locales() {
set -- \
"${SPCD_TXT_LOCALE_ENGLISH}" \
"${SPCD_TXT_LOCALE_FRENCH}"
local language locale text
spcd_txt_locales_echo
spcd_split
for locale in "${@}"; do
case "${1}" in
"glibc-langpack-")
language="$(echo "${locale}" | cut -d _ -f 1)"
spcd_install_package "glibc-langpack-${language}"
;;
"LANGUAGE")
if [ -n "${text}" ]; then
text="${text}:${locale}"
else
text="${locale}"
fi
;;
"locale.gen")
text="${text}\
${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET}
"
;;
*) ;;
esac
done
case "${1}" in
"LANGUAGE") export LANGUAGE="${text}" ;;
"locale.gen") spcd_os_write "/etc/locale.gen" "${text}" ;;
*) ;;
esac
spcd_split
spcd_txt_locales_echo
}
# ╭──────┬─────╮ # ╭──────┬─────╮
# │ step │ dns │ # │ step │ dns │
# ╰──────┴─────╯ # ╰──────┴─────╯