]> arthur.barton.de Git - ax-zsh.git/commitdiff
12_locale: Automatically set LANGUAGE when possible & useful
authorAlexander Barton <alex@barton.de>
Sun, 12 Mar 2017 16:11:49 +0000 (17:11 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 12 Mar 2017 16:11:49 +0000 (17:11 +0100)
core/12_locale/12_locale.zprofile

index 6d7e40f4f9995e20371f9b9d4805b4662fbdf673..5d976e1d7b8c38b48a46ecab52ad73df78dde4cc 100644 (file)
@@ -38,5 +38,14 @@ while true; do
                unset LANGUAGE LC_ALL LC_MESSAGES
        fi
 done
-
 unset lc_messages locale encoding
+
+case "$LANG" in
+       *_*)
+               # LANG contains at least one "_" ("aa_BB" form).
+               if [[ -z "$LANGUAGE" ]]; then
+                       # But LANGUAGE isn't set, so set it automatically to
+                       # "aa_BB:aa" form.
+                       export LANGUAGE=${LANG%.*}:${${LANG%.*}%_*}
+               fi
+esac