Just installed this for a client. Looks great. Made some mods and translated to finnish. I will up the translation as soon as I’ll get it cleaned.
But the mod is the main reason for me to write here.
I changed this (language selection part):
if(mysql_result($result,$i,"lang_frontend") == 'english'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="english"'.$dropdown2.'>English</option>';
if(mysql_result($result,$i,"lang_frontend") == 'danish'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="danish"'.$dropdown2.'>Dansk</option>';
if(mysql_result($result,$i,"lang_frontend") == 'italian'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="italian"'.$dropdown2.'>Italiano</option>';
if(mysql_result($result,$i,"lang_frontend") == 'german'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="german"'.$dropdown2.'>Deutsch</option>';
$list .= '</select></td></tr>';
$list .= '<tr><td> </td><td> '.$lang_config_lang_website_description.'</td></tr>';
$list .= '<tr><td><strong>'.$lang_config_lang_manager.'</strong></td><td>: <select name="lang_backend">';
if(mysql_result($result,$i,"lang_backend") == 'english'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="english"'.$dropdown2.'>English</option>';
if(mysql_result($result,$i,"lang_backend") == 'danish'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="danish"'.$dropdown2.'>Dansk</option>';
if(mysql_result($result,$i,"lang_backend") == 'italian'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="italian"'.$dropdown2.'>Italiano</option>';
if(mysql_result($result,$i,"lang_backend") == 'german'){$dropdown2 = ' selected="selected"';} else {$dropdown2 = '';}
$list .= '<option value="german"'.$dropdown2.'>Deutsch</option>';
to this:
$handle = opendir($path.'languages/');
while (false !== ($lang_file = readdir($handle))) {
if ($lang_file != "." && $lang_file != "..") {
$lang_file = explode(".",$lang_file);
$dropdown2 = mysql_result($result,$i,"lang_frontend") == $lang_file[0] ?'selected="selected"':'';
$list .= '<option value="'. $lang_file[0] .'" '. $dropdown2 .'>'. ucfirst($lang_file[0]).'</option>';
}
}
$list .= '</select></td></tr>';
$list .= '<tr><td> </td><td> '.$lang_config_lang_website_description.'</td></tr>';
$list .= '<tr><td><strong>'.$lang_config_lang_manager.'</strong></td><td>: <select name="lang_backend">';
rewinddir($handle);
while (false !== ($lang_file = readdir($handle))) {
if ($lang_file != "." && $lang_file != "..") {
$lang_file = explode(".",$lang_file);
$dropdown2 = mysql_result($result,$i,"lang_backend") == $lang_file[0] ?'selected="selected"':'';
$list .= '<option value="'. $lang_file[0] .'" '. $dropdown2 .'>'. ucfirst($lang_file[0]).'</option>';
}
}
closedir($handle);
Basically it reads all lang files from the directory and prints them to the selection. So no more adding lines to code when inserting a new translation. Just thought I’d share this.