REPORT: added "user_lang_pref()" to cs-shlib

Date: Sat, 28 Jun 1997 18:01:42 -0300
From: James Fifield <fifield@ug.cs.dal.ca>
To: CSuite Tech Reports <csuite-tech@chebucto.ns.ca>
Precedence: bulk
Return-Path: <csuite-tech-mml-owner@chebucto.ns.ca>

next message in archive
no next message in thread
previous message in archive
Index of Subjects


I've added a function to cs-shlib, it follows:

user_lang_pref() {
        # echo's user's language preference.
        # call with user's login name
        home=`eval echo ~$1`

        if [ -f $home/.lynxrc ]
        then
                # Get the users language pref.
                user_lang=`grep '^preferred_language=' $home/.lynxrc | gawk -F'=' '{ print $2 }'`
                if [ -n "$user_lang" ] && grep "$user_lang" $CS_CONF/lang >/dev/null
                then
                        echo "$user_lang"
                else
                        gawk -F'|' '{ print $1 }' $CS_CONF/lang
                fi
        else
                gawk -F'|' '{ print $1 }' $CS_CONF/lang

        fi
}


--

James Fifield	
fifield@ug.cs.dal.ca

CSuite Technical Staff

"Those who are willing to give up some liberty for some security lose 
both and deserve neither."  - Ben Franklin (I think)

next message in archive
no next message in thread
previous message in archive
Index of Subjects