Minor fix
This commit is contained in:
parent
e3a90b16ee
commit
308f0778ed
|
@ -4,7 +4,7 @@ $locale = '';
|
||||||
if(isset($_COOKIE['language'])) $locale = $_COOKIE['language'];
|
if(isset($_COOKIE['language'])) $locale = $_COOKIE['language'];
|
||||||
else if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
else if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
|
||||||
$langcode = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
$langcode = Locale::acceptFromHttp($_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||||
if(file_exists(__DIR__.'/locale/'.$langcode)) $locale = langcode;
|
if(file_exists(__DIR__.'/locale/'.$langcode)) $locale = $langcode;
|
||||||
else if(file_exists(__DIR__.'/locale/'.explode("_",$langcode)[0])) $locale = explode("_",$langcode)[0];
|
else if(file_exists(__DIR__.'/locale/'.explode("_",$langcode)[0])) $locale = explode("_",$langcode)[0];
|
||||||
else $locale = $config['App']['default_language'];
|
else $locale = $config['App']['default_language'];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue