mirror of
https://github.com/friendica/friendica
synced 2025-04-25 11:50:11 +00:00
provide ability to unset session language
This commit is contained in:
parent
030e1e82c3
commit
542aa22eb9
2 changed files with 12 additions and 2 deletions
|
@ -847,10 +847,16 @@ function lang_selector() {
|
|||
$o .= '<form action="" method="post" ><select name="system_language" onchange="this.form.submit();" >';
|
||||
$langs = glob('view/*/strings.php');
|
||||
if(is_array($langs) && count($langs)) {
|
||||
$langs[] = '';
|
||||
if(! in_array('view/en/strings.php',$langs))
|
||||
$langs[] = 'view/en/';
|
||||
asort($langs);
|
||||
foreach($langs as $l) {
|
||||
if($l == '') {
|
||||
$default_selected = ((! x($_SESSION,'language')) ? ' selected="selected" ' : '');
|
||||
$o .= '<option value="" ' . $default_selected . '>' . t('default') . '</option>';
|
||||
continue;
|
||||
}
|
||||
$ll = substr($l,5);
|
||||
$ll = substr($ll,0,strrpos($ll,'/'));
|
||||
$selected = (($ll === $lang) ? ' selected="selected" ' : '');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue