Load the language from AccountsService if available
This commit is contained in:
parent
270be39c68
commit
86f2a1fbfa
1 changed files with 19 additions and 1 deletions
|
@ -53,7 +53,25 @@ set -o noclobber
|
|||
export LC_ALL=''
|
||||
export TIME_STYLE="long-iso" # Used by GNU 'ls'.
|
||||
## Set the default language.
|
||||
if [ -r "$HOME/.config/user-dirs.locale" ]; then
|
||||
acctsvclang=$(dbus-send \
|
||||
--system \
|
||||
--print-reply=literal \
|
||||
--dest=org.freedesktop.Accounts \
|
||||
$(dbus-send \
|
||||
--system \
|
||||
--print-reply=literal \
|
||||
--dest=org.freedesktop.Accounts \
|
||||
--type=method_call \
|
||||
/org/freedesktop/Accounts \
|
||||
org.freedesktop.Accounts.FindUserById int64:$(id -u)) \
|
||||
org.freedesktop.DBus.Properties.Get \
|
||||
string:org.freedesktop.Accounts.User \
|
||||
string:Language \
|
||||
2>/dev/null \
|
||||
| awk '{print $2}')
|
||||
if [ -n "$acctsvclang" ]; then
|
||||
LANG=$acctsvclang
|
||||
elif [ -r "$HOME/.config/user-dirs.locale" ]; then
|
||||
LANG="$(cat $HOME/.config/user-dirs.locale).UTF-8"
|
||||
elif [ -r "$HOME/.config/locale.conf" ]; then
|
||||
. "$HOME/.config/locale.conf"
|
||||
|
|
Loading…
Reference in a new issue