From 05ccc94e9cd4ac86d98cfa7ab19107496e19c72b Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Wed, 4 Sep 2024 13:56:46 +0200 Subject: [PATCH] action,locale --- spcd/bootstrap.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index fa1222f..55f8f3b 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -378,6 +378,8 @@ spcd_txt_get() { } spcd_txt_locale() { + local action="${1}" + local locale="${2}" set -- \ "LANG" \ "LC_CTYPE" \ @@ -393,22 +395,22 @@ spcd_txt_locale() { "LC_MEASUREMENT" \ "LC_IDENTIFICATION" local value name - if [ "${1}" = "set" ]; then - if [ -n "${2}" ]; then - value="${2}" + if [ "${action}" = "set" ]; then + if [ -n "${locale}" ]; then + value="${locale}" else value="${_SPCD_TXT_LOCALE_DEFAULT}" fi value="${value}.${_SPCD_TXT_CHARSET}" fi for name in "${@}"; do - case "${1}" in + case "${action}" in "list") spcd_os_printenv "${name}" ;; "set") export "${name}=${value}" ;; *) ;; esac done - if [ "${1}" = "set" ]; then + if [ "${action}" = "set" ]; then spcd_txt_locale "list" fi }