From 194ff1b177cf09ea07e8dc08535e70daba6cdf64 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 4 Sep 2024 14:21:28 +0200 Subject: [PATCH] rewrite locale --- spcd/bootstrap.sh | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 84f9a05..4dd5e40 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -396,25 +396,33 @@ spcd_txt_locale() { "LC_TELEPHONE" \ "LC_MEASUREMENT" \ "LC_IDENTIFICATION" - local value name - if [ "${action}" = "set" ]; then + local name + case "${action}" in + "list") + if ! locale; then + for name in "${@}"; do + spcd_os_printenv "${name}" + done + fi + ;; + "set") + spcd_txt_locale "list" + spcd_split + local value if [ -n "${locale}" ]; then value="${locale}" else value="${_SPCD_TXT_LOCALE_DEFAULT}" fi value="${value}.${_SPCD_TXT_CHARSET}" - fi - for name in "${@}"; do - case "${action}" in - "list") spcd_os_printenv "${name}" ;; - "set") export "${name}=${value}" ;; - *) ;; - esac - done - if [ "${action}" = "set" ]; then + for name in "${@}"; do + export "${name}=${value}" + done + spcd_split spcd_txt_locale "list" - fi + ;; + *) ;; + esac } spcd_txt_locales_echo() {