| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_getCurrentLocale { |
| |
| local CURRENTLOCALE='' |
| local OPTION="$1" |
| |
| |
| CURRENTLOCALE=$(echo $LANG | sed -r 's!(^[a-z]{2,3}_[A-Z]{2}).+$!\1!') |
| |
| |
| |
| |
| if [[ $CURRENTLOCALE == '' ]];then |
| CURRENTLOCALE='en_US' |
| fi |
| |
| |
| case $OPTION in |
| |
| '--langcode-only' ) |
| echo "${CURRENTLOCALE}" | cut -d_ -f1 |
| ;; |
| |
| '--langcode-and-countrycode'| * ) |
| echo "${CURRENTLOCALE}" |
| ;; |
| esac |
| } |