Skip to content

Commit

Permalink
Fixed issue #11445: Better identification of language variants for au…
Browse files Browse the repository at this point in the history
…tomatic language detection in administration
  • Loading branch information
c-schmitz committed Jul 25, 2016
1 parent aae8c5f commit 839bbae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions application/helpers/common_helper.php
Expand Up @@ -7623,6 +7623,12 @@ function getBrowserLanguage()
if (!isset($aLanguages[$sLanguage]))
{
$sLanguage=str_replace('_','-',$sLanguage);
if (strpos($sLanguage,'-')!==false)
{
$aLanguage=explode('-',$sLanguage);
$aLanguage[1]=strtoupper($aLanguage[1]);
$sLanguage=implode('-',$aLanguage);
}
if (!isset($aLanguages[$sLanguage]))
{
$sLanguage=substr($sLanguage,0,strpos($sLanguage,'-'));
Expand Down

0 comments on commit 839bbae

Please sign in to comment.