Package: lxdm / 0.5.3-2

22_ubuntu_i18n_oneiric.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Description: Adapt to the Oneiric model for setting languages/locales.
Forwarded: not-needed
Author: Gunnar Hjalmarsson <ubuntu@gunnar.cc>

--- a/data/Xsession
+++ b/data/Xsession
@@ -9,9 +9,20 @@
 	LXSESSION=/usr/bin/startlxde
 fi
 
+[ -f /etc/profile ] && . /etc/profile
+[ -f ~/.profile ] && . ~/.profile
 [ -f /etc/xprofile ] && . /etc/xprofile
 [ -f ~/.xprofile ] && . ~/.xprofile
 
+# override ~/.profile if language was set on the greeter
+if [ -n "$GREETER_LANGUAGE" ]; then
+	language_list=${GREETER_LANGUAGE%.*}${GREETER_LANGUAGE#*.UTF-8}:en
+	export LANGUAGE="$language_list"
+	export LC_MESSAGES="$GREETER_LANGUAGE"
+	export LC_CTYPE="$GREETER_LANGUAGE"
+	export LC_COLLATE="$GREETER_LANGUAGE"
+fi
+
 if [ -f /etc/X11/xinit/xinitrc-common ]; then
 # fedora
 	. /etc/X11/xinit/xinitrc-common
--- a/src/lxdm.c
+++ b/src/lxdm.c
@@ -1297,11 +1297,6 @@
 			session=g_key_file_get_string(dmrc,"Desktop","Session",NULL);
 			alloc_session=TRUE;
 		}
-		if(!lang || !lang[0])
-		{
-			lang=g_key_file_get_string(dmrc,"Desktop","Language",NULL);
-			alloc_lang=TRUE;
-		}
 		g_key_file_free(dmrc);
 	}
 
@@ -1411,9 +1406,9 @@
 	/* optionally override $LANG, $LC_MESSAGES, and $LANGUAGE */
 	if( lang && lang[0] )
 	{
-		env=g_environ_setenv(env, "LANG", lang, TRUE);
-		env=g_environ_setenv(env, "LC_MESSAGES", lang, TRUE);
-		env=g_environ_setenv(env, "LANGUAGE", lang, TRUE);
+		/* use this special environment variable to set the language related
+		   env. variables from Xsession after ~/.profile has been sourced */
+		env=g_environ_setenv(env, "GREETER_LANGUAGE", lang, TRUE);
 	}
 
 	if( session_desktop_names && session_desktop_names[0] )