zsh: rewrite locale modification code
use a function to make it more readable and shorter
This commit is contained in:
parent
0c9d346602
commit
0afa2600f8
|
@ -82,15 +82,28 @@ if command -v virsh > /dev/null; then
|
|||
export LIBVIRT_DEFAULT_URI="qemu:///system"
|
||||
fi
|
||||
|
||||
# Use ISO 8601 date & time.
|
||||
if [[ "${LC_TIME}" != "en_DK.utf8" ]] && command -v locale > /dev/null; then
|
||||
[[ "$(locale --all-locales)" == *en_DK* ]] && export LC_TIME="en_DK.utf8"
|
||||
fi
|
||||
function _modify_locale() {
|
||||
local category=${1}
|
||||
local value=${2}
|
||||
|
||||
if command -v locale > /dev/null; then
|
||||
if [[ "$(locale --all-locales)" == *${value}* ]]; then
|
||||
export ${category}=${value}
|
||||
fi
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
# Use ISO 8601 date & time.
|
||||
_modify_locale LC_TIME en_DK.utf8
|
||||
# Use english messages
|
||||
if [[ "${LC_MESSAGES}" != "en_US.utf8" ]] && command -v locale > /dev/null; then
|
||||
[[ "$(locale --all-locales)" == *en_US* ]] && export LC_MESSAGES="en_US.utf8"
|
||||
fi
|
||||
_modify_locale LC_MESSAGES en_CA.utf8
|
||||
# Use german currency
|
||||
_modify_locale LC_MONETARY de_DE.utf8
|
||||
# german paper sizes
|
||||
_modify_locale LC_PAPER de_DE.utf8
|
||||
|
||||
unfunction _modify_locale
|
||||
|
||||
export CCACHE_DIR="/var/cache/ccache"
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user