#!/bin/sh
# Copyright (C) 2001 by Stefan Heimers (stefan.heimers@kosta.ch)
#
# This script decides which language version of
# the elem binary to start. The real binaries are
# elem-de (german) and elem-en (english)
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.



# If the User didn't set
# the $LANG environment variable
if [ "$LANG" == "C" ] ||  [ ! $LANG ]; then

 # If we are on a SuSE system
 if [ -e /etc/SuSEconfig/profile ]; then
  . /etc/SuSEconfig/profile
	echo "found language in SuSEconfig/profile: $LANG"
 fi

 # If the language was set in KDE
 if [ -e $HOME/.kde/share/config/kdeglobals ]; then
	export `grep Language $HOME/.kde/share/config/kdeglobals`
	if [ "$Language" != "C" ]; then
	 LANG=$Language
	 echo "found language in kdeglobals: $LANG"
	else
	 echo "KDE is set to default language, not overriding SuSEconfig settings"
    fi

 fi

fi

case $LANG in

# if $LANG looks german use the german version
         de*)
		  elem-de ;;
      german)
		  elem-de ;;

# else use the enlish version
           *)
          elem-en ;;
esac



