From 11c144c7c33d36a6e23100c1714060823ec6d2db Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 6 Sep 2024 21:20:13 +0200 Subject: [PATCH] locale/show --- readme.md | 1 - spcd/bootstrap.sh | 62 +++++++++++++++++++++-------------------------- 2 files changed, 27 insertions(+), 36 deletions(-) diff --git a/readme.md b/readme.md index c028469..42e91ea 100644 --- a/readme.md +++ b/readme.md @@ -239,7 +239,6 @@ Handle project workflows in a unified way: * locales * persist * restrict LC_* variables set for alpine - * test LC_* variables * test #### Shell → Python diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index 616a705..4155628 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -915,6 +915,31 @@ spcd_txt_locale() { spcd_split spcd_txt_locale "list" ;; + "show") + local regex + for name in "${@}"; do + case "${name}" in + # LC_CTYPE + "LC_NUMERIC") regex="^\(decimal\|thousands\|grouping\)" ;; + "LC_TIME") regex="^\(day\|mon\)" ;; + # LC_COLLATE + "LC_MONETARY") regex="^\(int_curr\|currency\|mon_\)" ;; + "LC_MESSAGES") regex="^\(yes\|no\)" ;; + "LC_PAPER") regex="^\(height\|width\)" ;; + "LC_NAME") regex="^name_m" ;; + "LC_ADDRESS") regex="^\(country\|lang\)_name" ;; + "LC_TELEPHONE") regex="^int_" ;; + "LC_MEASUREMENT") regex="^measurement=" ;; + "LC_IDENTIFICATION") regex="^\(language\|territory\|title\)" ;; + *) ;; + esac + spcd_split + echo "${name}" + if [ -n "${regex}" ]; then + locale --keyword-name "${name}" | grep "${regex}" + fi + done + ;; *) ;; esac } @@ -1231,41 +1256,8 @@ spcd_step__packages_install_locales() { spcd_txt_locales "install" spcd_step "Set" spcd_txt_locale "set" "${SPCD_TXT_LOCALE}" - spcd_step "Test" - # CTYPE - # NUMERIC - spcd_split - locale --keyword-name LC_NUMERIC | grep "^\(decimal\|thousands\|grouping\)" - # TIME - spcd_split - locale --keyword-name LC_TIME | grep "^\(day\|mon\)" - # COLLATE - # MONETARY - spcd_split - locale --keyword-name LC_MONETARY | grep "^\(int_curr\|currency\|mon_\)" - # MESSAGES - spcd_split - locale --keyword-name LC_MESSAGES | grep "^\(yes\|no\)" - # - # PAPER - spcd_split - locale --keyword-name LC_PAPER | grep "^\(height\|width\)" - # NAME - spcd_split - locale --keyword-name LC_NAME | grep "^name_m" - # ADDRESS - spcd_split - locale --keyword-name LC_ADDRESS | grep "^\(country\|lang\)_name" - # TELEPHONE - spcd_split - locale --keyword-name LC_TELEPHONE | grep "^int_" - # MEASUREMENT - spcd_split - locale --keyword-name LC_MEASUREMENT | grep "^measurement=" - # IDENTIFICATION - spcd_split - locale --keyword-name LC_IDENTIFICATION | - grep "^\(language\|territory\|title\)" + spcd_step "Show" + spcd_txt_locale "show" spcd_step_out }