diff --git a/readme.md b/readme.md index f84fb31..42e91ea 100644 --- a/readme.md +++ b/readme.md @@ -236,7 +236,9 @@ Handle project workflows in a unified way: * opensuse * opensuse * disable & enable https -* persist locales +* locales + * persist + * restrict LC_* variables set for alpine * test #### Shell → Python diff --git a/spcd/bootstrap.sh b/spcd/bootstrap.sh index c7dd25d..ce0d154 100644 --- a/spcd/bootstrap.sh +++ b/spcd/bootstrap.sh @@ -887,6 +887,9 @@ spcd_txt_locale() { ;; esac local name + for name in "${@}"; do + echo "${name}" + done case "${action}" in "list") if ! locale; then @@ -915,6 +918,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,8 +1259,8 @@ spcd_step__packages_install_locales() { spcd_txt_locales "install" spcd_step "Set" spcd_txt_locale "set" "${SPCD_TXT_LOCALE}" - spcd_step "Test" - date + spcd_step "Show" + spcd_txt_locale "show" spcd_step_out }