#!/bin/sh


# Grab location portion of localecode
LOCATIONCODE="${LOCALECODE##*_}"

# Convert locationcode from upper-case to lower-case
LOCATIONCODE=`echo $LOCATIONCODE | tr '[:upper:]' '[:lower:]'`

apt-get $APT_OPTIONS install -y --force-yes --ignore-missing pim-language-${LANGCODE}-${LOCATIONCODE}

# lightning-extension only supports es-es and es-ar. We force these
# translations to be used for all es-xx locales. This seems to be what
# Thunderbird automatically does.
if [ "$LANGCODE" = "es" ]; then
	apt-get $APT_OPTIONS install -y --force-yes --ignore-missing lightning-extension-locale-es-es lightning-extension-locale-es-ar
else
	apt-get $APT_OPTIONS install -y --force-yes --ignore-missing lightning-extension-locale-${LANGCODE}-${LOCATIONCODE}
fi


exit 0
