OSDN Git Service

upg
[joborun/jobcore.git] / filesystem / locale.sh
1 #!/bin/sh
2
3 # load locale.conf in XDG paths.
4 # /etc/locale.conf loads and overrides by kernel command line is done by systemd
5 # But we override it here, see FS#56688
6 if [ -z "$LANG" ]; then
7   if [ -n "$XDG_CONFIG_HOME" ] && [ -r "$XDG_CONFIG_HOME/locale.conf" ]; then
8     . "$XDG_CONFIG_HOME/locale.conf"
9   elif [ -n "$HOME" ] && [ -r "$HOME/.config/locale.conf" ]; then
10     . "$HOME/.config/locale.conf"
11   elif [ -r /etc/locale.conf ]; then
12     . /etc/locale.conf
13   fi
14 fi
15
16 # define default LANG to C if not already defined
17 LANG=${LANG:-C}
18
19 # export all locale (7) variables when they exist
20 export LANG 
21 [ -n "$LC_CTYPE" ]          && export LC_CTYPE
22 [ -n "$LC_NUMERIC" ]        && export LC_NUMERIC
23 [ -n "$LC_TIME" ]           && export LC_TIME
24 [ -n "$LC_COLLATE" ]        && export LC_COLLATE
25 [ -n "$LC_MONETARY" ]       && export LC_MONETARY
26 [ -n "$LC_MESSAGES" ]       && export LC_MESSAGES
27 [ -n "$LC_PAPER" ]          && export LC_PAPER
28 [ -n "$LC_NAME" ]           && export LC_NAME
29 [ -n "$LC_ADDRESS" ]        && export LC_ADDRESS
30 [ -n "$LC_TELEPHONE" ]      && export LC_TELEPHONE
31 [ -n "$LC_MEASUREMENT" ]    && export LC_MEASUREMENT
32 [ -n "$LC_IDENTIFICATION" ] && export LC_IDENTIFICATION
33 [ -n "$LANGUAGE" ]                      && export LANGUAGE