# Sourced by brintos-gnome-session: the session's locale, set as gdm and the # gnome-session wrapper set it with no display manager to do it. LANG is the # language the user chose in AccountsService, else the one already set, else # C.UTF-8; the format categories follow org.gnome.system.locale region. A # choice applies only when glibc loads it. ACCOUNTS_DIR=${ACCOUNTS_DIR:-/var/lib/AccountsService/users} _sl_loads() { [ -n "$1" ] && [ -z "$(LC_ALL=$1 locale 2>&1 >/dev/null)" ]; } _sl=$(sed -n 's/^Language=//p' "$ACCOUNTS_DIR/$USER" 2>/dev/null | head -n 1) _sl_loads "$_sl" && export LANG="$_sl" [ -n "$LANG" ] || export LANG=C.UTF-8 # As the session's account: dconf makes $XDG_RUNTIME_DIR/dconf as whoever reads first. _sl=$(G_MESSAGES_DEBUG='' $AS gsettings get org.gnome.system.locale region 2>/dev/null) _sl=${_sl#\'} _sl=${_sl%\'} if _sl_loads "$_sl"; then unset LC_TIME LC_NUMERIC LC_MONETARY LC_MEASUREMENT LC_PAPER if [ "$_sl" != "$LANG" ]; then export LC_NUMERIC="$_sl" LC_TIME="$_sl" LC_MONETARY="$_sl" LC_PAPER="$_sl" \ LC_ADDRESS="$_sl" LC_TELEPHONE="$_sl" LC_MEASUREMENT="$_sl" fi fi unset _sl unset -f _sl_loads