<?php
if(!empty($_COOKIE['lang']))$lang=$_COOKIE['lang'];
if(!empty($_GET['lang']))$lang=$_GET['lang'];
if(!empty($lang) && ($lang=='en' || $lang=='fr' || $lang=='es'
        || $lang=='nl'|| $lang=='fi' || $lang=='it' || $lang=='de' || $lang=='pt' || $lang=='gr')){
  include('lang_'.$lang.'.php');
  setcookie('lang',$lang,time()+3600*25*365,'/');
}else include('lang_en.php'); //Eng by default
// echo "webui_welcome = $webui_welcome";
?>
<?php
if(!empty($_COOKIE['lang']))$lang=$_COOKIE['lang'];
if(!empty($_GET['lang']))$lang=$_GET['lang'];
if(!empty($lang) && array_key_exists($lang, $languages))
{
    include('lang_'.$lang.'.php');
    setcookie('lang',$lang,time()+3600*25*365,'/');
}
else
    include('lang_en.php'); //Eng by default
// echo "webui_welcome = $webui_welcome";
?>
Remove very messy old language code and replace it with something that doesn't require changing every time a language is added.
Remove very messy old language code and replace it with something that doesn't require changing every time a language is added.
