-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.bash_profile.locale
23 lines (17 loc) · 1.13 KB
/
.bash_profile.locale
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# vim: ft=bash noet:
! declare 2>&1 | grep -wq ^colors= && [ $BASH_VERSINFO -ge 4 ] && source $initDir/.colors
test "$debug" -gt 0 && echo "=> Running $bold${colors[blue]}$(basename ${BASH_SOURCE[0]})$normal ..."
test "$debug" -gt 1 && localectl status
test "$debug" -gt 2 && locale
test "$debug" -gt 3 && set -x
test -z "$LANG" && export LANG=$(locale -a 2>/dev/null | egrep -i -m1 '^(fr_FR|en_US|en_UK).utf-?8')
if locale -a | egrep -iq "c.utf-?8";then
export LC_{CTYPE,COLLATE,MESSAGES}=C.UTF-8 || export LC_{CTYPE,COLLATE,MESSAGES}=$(locale -a 2>/dev/null | egrep -i -m1 '^(en_US|en_UK).utf-?8')
fi
export LC_{ADDRESS,IDENTIFICATION,MEASUREMENT,MONETARY,NAME,NUMERIC,PAPER,TELEPHONE,TIME}=$(locale -a 2>/dev/null | egrep -i -m1 '^fr_FR.utf-?8') # Locale parameters for France
export LC_TIME=$(locale -a 2>/dev/null | egrep -i -m1 '^fr_FR.utf-?8') # Heures et dates francaises
export LANGUAGE=en:C:fr # i.e https://unix.stackexchange.com/a/181867/135038
test "$debug" -gt 1 && localectl status
test "$debug" -gt 2 && locale
test "$debug" -lt 3 && set +x
test "$debug" -gt 0 && echo "=> END of $bold${colors[blue]}$(basename ${BASH_SOURCE[0]})$normal"