Skip to content
Snippets Groups Projects
Commit 72fe339c authored by Thomas Müller's avatar Thomas Müller
Browse files

Merge pull request #766 from btactic/language_autodetect

Improve autodetection of language.
parents bac4e011 7b0e2b34
No related branches found
No related tags found
No related merge requests found
......@@ -294,8 +294,14 @@ class OC_L10N{
}
foreach($accepted_languages as $i) {
$temp = explode(';', $i);
if(array_search($temp[0], $available) !== false) {
return $temp[0];
$temp[0] = str_replace('-','_',$temp[0]);
if( ($key = array_search($temp[0], $available)) !== false) {
return $available[$key];
}
foreach($available as $l) {
if ( $temp[0] == substr($l,0,2) ) {
return $l;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment