<?php
header('Content-Type: application/javascript');

$language = 'default';
$file = '../../Private/Language/produktliste_locallang.xml';


$xml = simplexml_load_file($file);


$labels = array();

foreach ($xml->data->languageKey as $xmllanguage) {


    foreach ($xmllanguage as $value) {
        $labels[(string)$xmllanguage['index']][(string)$value->attributes()->index] = (string)$value;
    }

}

echo "var SW_LANG = " . json_encode($labels);