#!/bin/sh
set -e
LOCALE=hu_HU

VALUE=$(gconftool-2 --get /apps/osso/applet/languageregional/available_languages);
VALUE=$(echo $VALUE | sed 's/\s//g');
TEST=$(echo `echo $VALUE | grep "[^[:alpha:]]$LOCALE[^[:alpha:]_]"`);

if [ x"$TEST" == "x"  ]; then
	VALUE=$(echo $VALUE | sed "s/]/,$LOCALE]/g");
fi

VALUE=$(echo $VALUE | sed 's/\[,/\[/g');


case "$1" in
  configure)
    gconftool-2 --set /apps/osso/applet/languageregional/available_languages --type=list --list-type=string "$VALUE"
    exit 0
  ;;
  
  abort-upgrade|abort-remove|abort-deconfigure)
  ;;

  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

exit 0
