aboutsummaryrefslogtreecommitdiffstats
path: root/lang.sh
blob: f31c34e2d4a715c0051a39f2f43af64cce68b1fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash

if [ -f /etc/sysconfig/i18n ]; then
    . /etc/sysconfig/i18n

    if [ -n "$LANG" ]; then
	export LANG
    fi

    if [ -n "$LC_ALL" ]; then
	export LC_ALL
    fi
  
    if [ -n "$LINGUAS" ]; then
	export LINGUAS
    fi
  
    if [ -n "$SYSTERM" ]; then
	export TERM=$SYSTERM
    fi

    # Set console font map.
    if [ -n "$UNIMAP" ]; then
	loadunimap $UNIMAP
    fi
    
    if [ -n "$SYSFONTACM" ]; then
        case $SYSFONTACN in
	   iso01*|iso02*|iso15*)
	        LESSCHARSET=latin1
		INPUTRC=/etc/inputrc
		export LESSCHARSET INPUTRC
		if [ "$TERM" = "linux" ]; then
		    if ls -l /proc/$$/fd/0 2>/dev/null | grep -- '-> /dev/tty[0-9]*$' >/dev/null 2>&1; then
			echo -n -e '\033(K' > /proc/$$/fd/0
		    fi
		fi
		;;
       esac
    fi

    if [ -n "$SYSTERM" ] ; then
	case $SYSTERM in
	    linux-lat)
		LESSCHARSET=latin1
		INPUTRC=/etc/inputrc
		export LESSCHARSET INPUTRC
		;;
	esac
    fi
    unset SYSFONTACM
fi