From 80b64d4b2693b1aefc78db30ec5a75f8955c248a Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 17 2012 00:57:41 +0000 Subject: Update `Functions/Locale/locale_getCurrentLocale.sh' file. --- diff --git a/Scripts/Bash/Functions/Locale/locale_getCurrentLocale.sh b/Scripts/Bash/Functions/Locale/locale_getCurrentLocale.sh index f21c280..df1c022 100755 --- a/Scripts/Bash/Functions/Locale/locale_getCurrentLocale.sh +++ b/Scripts/Bash/Functions/Locale/locale_getCurrentLocale.sh @@ -26,28 +26,7 @@ function locale_getCurrentLocale { - local CURRENTLOCALE='' - local OPTION="$1" - # Redefine current locale using LL_CC format. - CURRENTLOCALE=$(echo $LANG | sed -r 's!(^[a-z]{2,3}_[A-Z]{2}).+$!\1!') - - # Define centos-art.sh script default current locale. If - # centos-art.sh script doesn't support current system locale, use - # English language from United States as default current locale. - if [[ $CURRENTLOCALE == '' ]];then - CURRENTLOCALE='en_US' - fi - - # Output current locale. - case $OPTION in - - '--langcode-only' ) - echo "${CURRENTLOCALE}" | cut -d_ -f1 - ;; + echo $LANG | sed -r 's!(^[a-z]{2,3}_[A-Z]{2}).+$!\1!' - '--langcode-and-countrycode'| * ) - echo "${CURRENTLOCALE}" - ;; - esac }