#!/bin/bash

# Including wrapper script:
. /usr/lib/java-wrappers/java-wrappers.sh

# We need openjdk, icedtea  or Sun 6
find_java_runtime openjdk || find_java_runtime icedtea || find_java_runtime sun6

find_jars higlayout wstx-lgpl freecol

# We test if LC_MESSAGES is different from LC_CTYPE, if that is the case,
# we pass to freecol the --default-locale argument
if [ "$LC_CTYPE" != "$LC_MESSAGES" -a "$LC_MESSAGES" ]; then
    lang_argument="--default-locale=$LC_MESSAGES"
fi

run_java -Xmx180M net.sf.freecol.FreeCol --freecol-data \
    /usr/share/games/freecol $lang_argument "$@"
