##########################################################################
# file:        SessionLang
# description: $LANG environment variable setup common to all session scripts.
#
# This file is to be sourced in all session scripts in the
# /etc/X11/gdm/Sessions directory. It must be sourced, not executed as a
# child process, for the $LANG environment variable to initialize properly. 
#
##########################################################################

# If gdm specified a language, try to use it to set LANG.
if [ -n "$GDM_LANG" ]; then
  if [ "`echo $GDM_LANG | grep 15`" = "" ]; then
    LANG=`echo $GDM_LANG | cut -d. -f1`
  else
    LANG="`echo $GDM_LANG | cut -d. -f1`@euro"
  fi
fi

# If gdm did not specify a language to use default to the keyboad language
if [ -z "$LANG" -o "$LANG" = "C" ]; then
   case `cat /tmp/snmp/106` in
        0) LANG="en_US" ;;	# English in United States
        4) LANG="de_DE" ;;	# German in Germany
        5) LANG="fr_FR" ;;	# French in France
        6) LANG="be_BE" ;;
        7) LANG="de_CH" ;;	# German in Switzerland
        8) LANG="es_ES" ;;	# Spanish in Spain
        9) LANG="en_GB" ;;	# English in Great Britain
       10) LANG="it_IT" ;;	# Italian in Italy
       11) LANG="en_CA" ;;
       12) LANG="no_NO" ;;	# Norwegian in Norway
       13) LANG="fi_FI" ;;	# Finish in Finland
       14) LANG="pt_PT" ;;	# Portugese in Portugal
       15) LANG="da_DK" ;;	# Danish in Denmark
       16) LANG="nl_BE" ;;
       43) LANG="fr_CA" ;;	# French in Canada
       44) LANG="fr_BE" ;;	# French in Belgium
       45) LANG="fr_CA" ;;
       46) LANG="fr_CH" ;;	# French in Switzerland
#       47) LANG="" ;;
      109) LANG="es_LA" ;;	# Spanish in Latin America
#      110) LANG="" ;;
      111) LANG="is_IS" ;;
      112) LANG="en_US" ;;	# English in United States (ISO)
      113) LANG="en_US" ;;
      114) LANG="en_GB" ;;
      115) LANG="fr_CH" ;;
      116) LANG="de_CH" ;;
      117) LANG="fr_FR" ;;
      118) LANG="it_IT" ;;
      119) LANG="es_ES" ;;
      120) LANG="es_LA" ;;
      121) LANG="de_DE" ;;
      122) LANG="de_DE" ;;
      123) LANG="fr_CA" ;;
#      140) LANG="" ;;
      141) LANG="pt_BR" ;;
      142) LANG="bg_BG" ;;
#      143) LANG="" ;;
      144) LANG="cz_CZ" ;;
      145) LANG="el_GR" ;;
      146) LANG="iw_IL" ;;
      147) LANG="hu_HU" ;;
      148) LANG="ko_KR" ;;
      149) LANG="pl_PL" ;;
      150) LANG="ro_RO" ;;
      151) LANG="ru_RU" ;;
      152) LANG="ru_RU" ;;
#      153) LANG="" ;;
      154) LANG="sk_SK" ;;
      155) LANG="sl_SI" ;;
      156) LANG="th_TH" ;;
#      157) LANG="" ;;
      158) LANG="tr_TR" ;;
      159) LANG="tr_TR" ;;
#      160) LANG="" ;;
      161) LANG="et_EE" ;;
      162) LANG="ko_KR" ;;
#      163) LANG="" ;;
      164) LANG="lt_LT" ;;
      165) LANG="pl_PL" ;;
#      166) LANG="" ;;
      167) LANG="sv_SE" ;;	# Swedish in Sweden
#      168) LANG="" ;;
#      169) LANG="" ;;
      170) LANG="it_CH" ;;
      171) LANG="es_CA" ;;
      172) LANG="jp_JP" ;;

      *) LANG="en_US" ;;
   esac
fi

export LANG


