mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-16 20:05:14 +02:00
change language dynamically - bound to F8 key
This commit is contained in:
parent
75ad3219e6
commit
08032e0453
6 changed files with 64 additions and 0 deletions
20
boot.php
20
boot.php
|
@ -2669,3 +2669,23 @@ function extract_item_authors($arr,$uid) {
|
|||
}
|
||||
return array();
|
||||
}}
|
||||
|
||||
if(! function_exists('lang_selector')) {
|
||||
function lang_selector() {
|
||||
global $lang;
|
||||
$o .= '<div id="language-selector" style="display: none;" >';
|
||||
$o .= '<form action="" method="post" ><select name="system_language" onchange="this.form.submit();" >';
|
||||
$langs = glob('view/*/strings.php');
|
||||
if(is_array($langs) && count($langs)) {
|
||||
if(! in_array('view/en/strings.php',$langs))
|
||||
$langs[] = 'view/en/';
|
||||
foreach($langs as $l) {
|
||||
$ll = substr($l,5);
|
||||
$ll = substr($ll,0,strrpos($ll,'/'));
|
||||
$selected = (($ll === $lang) ? ' selected="selected" ' : '');
|
||||
$o .= '<option value="' . $ll . '"' . $selected . '>' . $ll . '</option>';
|
||||
}
|
||||
}
|
||||
$o .= '</select></form></div>';
|
||||
return $o;
|
||||
}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue