diff --git a/readme.md b/readme.md index 8d54773..1b93a7f 100644 --- a/readme.md +++ b/readme.md @@ -229,8 +229,6 @@ Handle project workflows in a unified way: * selected * available * effective -* factorize - * locales * handle errors * packages * configure diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 03374b9..8427ef2 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -411,35 +411,31 @@ spcd_txt_locales() { set -- \ "${SPCD_TXT_LOCALE_ENGLISH}" \ "${SPCD_TXT_LOCALE_FRENCH}" - local locale - case "${1}" in - "glibc-langpack-") - local language - for locale in "${@}"; do + local language locale text + for locale in "${@}"; do + case "${1}" in + "glibc-langpack-") language="$(echo "${locale}" | cut -d _ -f 1)" spcd_install_package "glibc-langpack-${language}" - done - ;; - "LANGUAGE") - local text - for locale in "${@}"; do + ;; + "LANGUAGE") if [ -n "${text}" ]; then text="${text}:${locale}" else text="${locale}" fi - done - export LANGUAGE="${text}" - ;; - "locale.gen") - local text - for locale in "${@}"; do + ;; + "locale.gen") text="${text}\ ${locale}.${_SPCD_TXT_CHARSET} ${_SPCD_TXT_CHARSET} " - done - spcd_os_write "/etc/locale.gen" "${text}" - ;; + ;; + *) ;; + esac + done + case "${1}" in + "LANGUAGE") export LANGUAGE="${text}" ;; + "locale.gen") spcd_os_write "/etc/locale.gen" "${text}" ;; *) ;; esac }