@@ -30,19 +30,6 @@ cleanup()
3030 exit 0
3131}
3232
33−# Define language here for phone if available. When phone user switches their
34−# language, they expect that to affect the greeter too. But the user doesn't
35−# have permission to switch system language, only their own. So we notice if
36−# the phablet user exists and use their language if so. TODO: talk to design
37−# about whether we should switch language on fly as users are selected (this
38−# is very hard to do technically).
39−if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
40− 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)
41− if [ -n "$USER_LANG" ]; then
42− export LANGUAGE="$USER_LANG"
43− fi
44−fi
45−
4633SUB_SOCKET=$XDG_RUNTIME_DIR/mir_socket
4734rm -f $SUB_SOCKET # clear socket in case we were hard shut down
4835
@@ -65,6 +52,22 @@ export UPSTART_SESSION=$(/sbin/initctl list-sessions | grep "^$INIT_PID " | cut
6552# Start any pre-greeter tasks if needed (like wizard)
6653/sbin/initctl emit unity8-greeter-starting
6754
55+# Define language here for phone if available. When phone user switches their
56+# language, they expect that to affect the greeter too. But the user doesn't
57+# have permission to switch system language, only their own. So we notice if
58+# the phablet user exists and use their language if so. TODO: talk to design
59+# about whether we should switch language on fly as users are selected (this
60+# is very hard to do technically).
61+#
62+# Do this after unity8-greeter-starting, in case a customization upstart job
63+# changes language.
64+if [ "$(id -u phablet 2>/dev/null)" = "32011" ]; then
65+ 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)
66+ if [ -n "$USER_LANG" ]; then
67+ export LANGUAGE="$USER_LANG"
68+ fi
69+fi
70+
6871# And finally actually start the greeter
6972exec env MIR_SERVER_FILE=$SUB_SOCKET $TOUCH_WRAPPER $@ &
7073CMD_PID=$!