add language templates and fix main.php a bit