locale.sh 766 B

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