#!/bin/sh

BLOCK=$(basename $(dirname `readlink -f $0`))
XSL="$BLOCK.raw2xml.xsl"
LOCALES=${LOCALES:-"ru uk en be az tt kk tr"}
TABS=${TABS:-"advertising communication search-and-content morda webmaster com turkish"}

for l in $LOCALES; do
    for t in $TABS; do
        if [ -e "$BLOCK.raw.$t.$l.xml" ]; then
            input="$BLOCK.raw.$t.$l.xml"
        else
            input="$BLOCK.raw.$t.xml"
        fi
        output="b-head-tabs.xml.$t.$l.xml"
        xsltproc --stringparam locale $l $XSL $input > $output
    done
done

