Adding debian version 0.4.1-1 (FIXME).
[debian/lxdm.git] / debian / patches / 22_ubuntu_i18n_oneiric.patch
1 Description: Adapt to the Oneiric model for setting languages/locales.
2 Forwarded: not-needed
3 Author: Gunnar Hjalmarsson <ubuntu@gunnar.cc>
4
5 --- lxdm.orig/data/Xsession     2011-07-29 15:42:33 +0200
6 +++ lxdm/data/Xsession  2011-09-30 13:53:51 +0200
7 @@ -9,9 +9,20 @@
8         LXSESSION=/usr/bin/startlxde
9  fi
10  
11 +[ -f /etc/profile ] && . /etc/profile
12 +[ -f ~/.profile ] && . ~/.profile
13  [ -f /etc/xprofile ] && . /etc/xprofile
14  [ -f ~/.xprofile ] && . ~/.xprofile
15  
16 +# override ~/.profile if language was set on the greeter
17 +if [ -n "$GREETER_LANGUAGE" ]; then
18 +       language_list=${GREETER_LANGUAGE%.*}${GREETER_LANGUAGE#*.UTF-8}:en
19 +       export LANGUAGE="$language_list"
20 +       export LC_MESSAGES="$GREETER_LANGUAGE"
21 +       export LC_CTYPE="$GREETER_LANGUAGE"
22 +       export LC_COLLATE="$GREETER_LANGUAGE"
23 +fi
24 +
25  if [ -f /etc/X11/xinit/xinitrc-common ]; then
26  # fedora
27         . /etc/X11/xinit/xinitrc-common
28
29 --- lxdm.orig/src/lxdm.c        2011-09-30 13:33:12 +0200
30 +++ lxdm/src/lxdm.c     2011-09-30 14:02:20 +0200
31 @@ -1369,11 +1369,6 @@
32                         session=g_key_file_get_string(dmrc,"Desktop","Session",NULL);
33                         alloc_session=TRUE;
34                 }
35 -               if(!lang || !lang[0])
36 -               {
37 -                       lang=g_key_file_get_string(dmrc,"Desktop","Language",NULL);
38 -                       alloc_lang=TRUE;
39 -               }
40                 g_key_file_free(dmrc);
41         }
42  
43 @@ -1478,9 +1473,9 @@
44         /* optionally override $LANG, $LC_MESSAGES, and $LANGUAGE */
45         if( lang && lang[0] )
46         {
47 -               replace_env(env, "LANG=", lang);
48 -               replace_env(env, "LC_MESSAGES=", lang);
49 -               replace_env(env, "LANGUAGE=", lang);
50 +               /* use this special environment variable to set the language related
51 +                  env. variables from Xsession after ~/.profile has been sourced */
52 +               replace_env(env, "GREETER_LANGUAGE=", lang);
53         }
54         s->env = env;
55  
56