|
|
|
|
|
|
|
|
|
|
|
|
|
|
// set language |
|
|
// set language |
|
|
$languages = $f3->get('languages'); |
|
|
$languages = $f3->get('languages'); |
|
|
|
|
|
if ( ! is_array($languages) ) { |
|
|
|
|
|
$languages = [$languages]; |
|
|
|
|
|
} |
|
|
$f3->set('default_lang', array_shift($languages)); |
|
|
$f3->set('default_lang', array_shift($languages)); |
|
|
if (in_array(strtolower($f3->get('GET.lang')), $languages)) { |
|
|
if (in_array(strtolower($f3->get('GET.lang')), $languages)) { |
|
|
$f3->set('LANG', strtolower($f3->get('GET.lang'))); |
|
|
|
|
|
|
|
|
$f3->set('LANG', strtolower($f3->get('GET.lang'))); |
|
|
} else { |
|
|
} else { |
|
|
$f3->set('LANG', $f3->get('default_lang')); |
|
|
|
|
|
|
|
|
$f3->set('LANG', $f3->get('default_lang')); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// set content dir |
|
|
// set content dir |
|
|
if(array_key_exists($f3->get('LANG'), $f3->get('content'))) { |
|
|
if(array_key_exists($f3->get('LANG'), $f3->get('content'))) { |
|
|
$content_dir=$f3->get('content.'.$f3->get('LANG')); |
|
|
$content_dir=$f3->get('content.'.$f3->get('LANG')); |