#!/bin/bash

langdir="/etc/X11/xinit/lang.d"

case $# in
0|1)
	echo "USAGE: $0 language command [...]"
	exit 1
	;;
esac

if [ ! -f "$langdir/$1" ]; then
	echo "$langdir/$1: not found"
	exit 1
fi

unset LC_COLLATE LC_CTYPE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
unset LC_ALL LANG LANGUAGE GETTEXT_ICONV
source "$langdir/$1"

shift
exec "$@"

