#!/bin/sh

# /.../
# Find out which language SaX2 will use for
# the user interface:
# ---
tmplang=${LANGUAGE-${LC_ALL-${LC_MESSAGES-${LANG-en_US}}}}

# /.../
# run fvwm with LC_ALL set to a suitable UTF-8 locale for that language
# because
# - display the UTF-8 texts received from SaX2 correctly
# - make the alias "sans-serif" from fvwmrc expand to a suitable font
#   for the language
# ---
export LC_ALL=`echo ${tmplang} |sed -e 's/[.@:].*//'`.UTF-8

FVWMRC=/usr/share/sax/api/data/fvwmrc.sax
TWMRC=/usr/share/sax/api/data/twmrc.sax

which fvwm2 >/dev/null 2>&1 && exec fvwm2 -f $FVWMRC "$@"
exec twm -f $TWMRC "$@"
