#!/bin/ksh
#
# Motif
#
# Copyright (c) 1987-2012, The Open Group. All rights reserved.
#
# These libraries and programs are free software; you can
# redistribute them and/or modify them under the terms of the GNU
# Lesser General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# These libraries and programs are distributed in the hope that
# they will be useful, but WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
# PURPOSE. See the GNU Lesser General Public License for more
# details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with these librararies and programs; if not, write
# to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
# Floor, Boston, MA 02110-1301 USA
#
#
# HISTORY
#
#   $XConsortium: xmfile /main/5 1995/07/14 10:04:31 drk $

# set file search path for Xlib to find locale defs with Ximp
XFILESEARCHPATH=/usr/lib/X11/nls/%L/%N:/usr/lib/X11/nls/Ximp/%L/%N
# set file search path for Xlib to find locale defs with Xsi
XNLSPATH=/usr/lib/X11/nls/Xsi
if (test $# -lt 1)
then
        language=french
else
        language=$1
fi
# set XAPPLRESDIR for UIL to find its files

# set user file search path for Xt to find app-default file
# XUSERFILESEARCHPATH=$XAPPLRESDIR/%C/%L/%N:$XAPPLRESDIR/%C/%l/%N:$XAPPLRESDIR/%C/%t/%N:$XAPPLRESDIR/%C/%N:$XAPPLRESDIR/%L/%N:$XAPPLRESDIR/%l/%N:$XAPPLRESDIR/%t/%N:$XAPPLRESDIR/%N:$HOME%N

export LANG XFILESEARCHPATH XAPPLRESDIR XNLSPATH
typeset sysname=
if [ -n "$(whence uname)" ]
then 
	typeset sysname=$(uname -s)
else
	typeset sysname="unix"
fi
case $sysname in
	HP-UX | ULTRIX | OSF1 )
	echo Operating System is $sysname
	;;
	* )
	echo Operating System is unknown !!!
	echo You should update xmfile script to support your OS
	;;
esac

case $language in
  french)
        XAPPLRESDIR=$(pwd)/french
	case $sysname in
	HP-UX)
		LANG=french.iso88591
		;;
	ULTRIX)
		LANG=FRE_FR.8859
		;;
	OSF1)
		LANG=fr_FR.ISO88591
		;;
	* )
		LANG=french
		;;
	esac
	;;

  english | american )
        XAPPLRESDIR=$(pwd)/american
        case $sysname in
	HP-UX)
		LANG=american
		;;
	ULTRIX)
		LANG=ENG_GB.8859
		;;
	OSF1)
		LANG=en_US.ISO88591
		;;
	* )
		LANG=american
		;;
	esac
	;;

  german)
        XAPPLRESDIR=$(pwd)/german
        case $sysname in
	HP-UX)
		LANG=german.iso88591
		;;
	ULTRIX)
		LANG=GER_GE.8859
		;;
	OSF1)
		LANG=en_US.ISO88591
		;;
	* )
		LANG=german
		;;
	esac
	;;

 * )
	echo unknown language $language -- try running in C locale
        XAPPLRESDIR=$(pwd)
	unset LANG
	;;	
esac
./fileview -ok
