rewrite locale
This commit is contained in:
parent
e42561f3c1
commit
194ff1b177
1 changed files with 20 additions and 12 deletions
|
@ -396,25 +396,33 @@ spcd_txt_locale() {
|
||||||
"LC_TELEPHONE" \
|
"LC_TELEPHONE" \
|
||||||
"LC_MEASUREMENT" \
|
"LC_MEASUREMENT" \
|
||||||
"LC_IDENTIFICATION"
|
"LC_IDENTIFICATION"
|
||||||
local value name
|
local name
|
||||||
if [ "${action}" = "set" ]; then
|
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
|
if [ -n "${locale}" ]; then
|
||||||
value="${locale}"
|
value="${locale}"
|
||||||
else
|
else
|
||||||
value="${_SPCD_TXT_LOCALE_DEFAULT}"
|
value="${_SPCD_TXT_LOCALE_DEFAULT}"
|
||||||
fi
|
fi
|
||||||
value="${value}.${_SPCD_TXT_CHARSET}"
|
value="${value}.${_SPCD_TXT_CHARSET}"
|
||||||
fi
|
|
||||||
for name in "${@}"; do
|
for name in "${@}"; do
|
||||||
case "${action}" in
|
export "${name}=${value}"
|
||||||
"list") spcd_os_printenv "${name}" ;;
|
done
|
||||||
"set") export "${name}=${value}" ;;
|
spcd_split
|
||||||
|
spcd_txt_locale "list"
|
||||||
|
;;
|
||||||
*) ;;
|
*) ;;
|
||||||
esac
|
esac
|
||||||
done
|
|
||||||
if [ "${action}" = "set" ]; then
|
|
||||||
spcd_txt_locale "list"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
spcd_txt_locales_echo() {
|
spcd_txt_locales_echo() {
|
||||||
|
|
Loading…
Reference in a new issue