#!/bin/bash

set -e

cd languages

for i in *; do
    wfile="$i/weekday.xpm"
    mfile="$i/month.xpm"
    ext="XX"
    case $i in
	breton) 
	    ext="br"
	    ;;
	czech) 
	    ext="cs"
	    ;;
	danish) 
	    ext="da"
	    ;;
	dutch) 
	    ext="nl"
	    ;;
	english) 
	    ext="en"
	    ;;
	french) 
	    ext="fr"  # There are two versions present
	    ;;
	german) 
	    ext="de"
	    ;;
	hebrew) 
	    ext="he"
	    ;;
	hungarian) 
	    ext="hu"
	    ;;
	indonesian) 
	    ext="id"
	    ;;
	italian) 
	    ext="it"
	    ;;
	japanese) 
	    ext="ja"
	    ;;
	norwegian) 
	    ext="nb"
	    ;;
	portuguese) 
	    ext="pt"
	    ;;
	russian) 
	    ext="ru"
	    ;;
	slovene) 
	    ext="sl"
	    ;;
	spanish) 
	    ext="es"
	    ;;
	swedish) 
	    ext="sv"
	    ;;
	ukrainian) 
	    ext="uk"
	    ;;
    esac
    if [ x$ext == "xXX" ]; then
	echo "Unknown language: $i"
	exit 1
    fi
    for j in ../debian/asclock-themes/usr/share/asclock/*; do
	cp -ip $wfile $j/weekday.${ext}.xpm
	cp -ip $mfile $j/month.${ext}.xpm
    done
done

cd -
