Fix: Fix autodetect language for greek.
This commit is contained in:
parent
3a3b5cc3a2
commit
4b1f775b07
@ -100,10 +100,10 @@ class Translate {
|
||||
// We redefine $srclang
|
||||
$langpart=explode("_",$codetouse);
|
||||
//print "Short before _ : ".$langpart[0].'/ Short after _ : '.$langpart[1].'<br>';
|
||||
// Array to convert short lang code into other long code.
|
||||
$longforshort=array('ar'=>'ar_SA', 'el'=>'el_GR', 'ca'=>'ca_ES', 'en'=>'en_US', 'nb'=>'nb_NO', 'no'=>'nb_NO');
|
||||
if (isset($langpart[1])) // If it's for a codetouse that is a long code xx_YY
|
||||
{
|
||||
// Array force long code from first part, even if long code is defined
|
||||
$longforshort=array('ar'=>'ar_SA');
|
||||
if (isset($longforshort[strtolower($langpart[0])])) $srclang=$longforshort[strtolower($langpart[0])];
|
||||
else {
|
||||
$srclang=strtolower($langpart[0])."_".strtoupper($langpart[1]);
|
||||
@ -112,6 +112,8 @@ class Translate {
|
||||
}
|
||||
}
|
||||
else { // If it's for a codetouse that is a short code xx
|
||||
// Array to convert short lang code into long code.
|
||||
$longforshort=array('ar'=>'ar_SA', 'el'=>'el_GR', 'ca'=>'ca_ES', 'en'=>'en_US', 'nb'=>'nb_NO', 'no'=>'nb_NO');
|
||||
if (isset($longforshort[strtolower($langpart[0])])) $srclang=$longforshort[strtolower($langpart[0])];
|
||||
else $srclang=strtolower($langpart[0])."_".strtoupper($langpart[0]);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user