@@ -28,6 +28,19 @@ cleanup()
2828 exit 0
2929}
3030
31+# Define language here for phone if available. When phone user switches their
32+# language, they expect that to affect the greeter too. But the user doesn't
33+# have permission to switch system language, only their own. So we notice if
34+# the phablet user exists and use their language if so. TODO: talk to design
35+# about whether we should switch language on fly as users are selected (this
36+# is very hard to do technically).
37+if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
38+ USER_LANG=$(gdbus call --system --dest org.freedesktop.Accounts --object-path /org/freedesktop/Accounts/User32011 --method org.freedesktop.DBus.Properties.Get org.freedesktop.Accounts.User Language | cut -d\' -f2)
39+ if [ -n "$USER_LANG" ]; then
40+ export LANGUAGE="$USER_LANG"
41+ fi
42+fi
43+
3144SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
3245rm -f $SUB_SOCKET # clear socket in case we were hard shut down
3346