Fix multilang

This commit is contained in:
Laurent Destailleur 2020-02-27 21:57:36 +01:00
parent 2d841d9d83
commit 2205667ca0

View File

@ -1412,7 +1412,7 @@ class Website extends CommonObject
$countrycode = strtolower(substr($languagecodeselected, -2));
$label = $weblangs->trans("Language_".$languagecodeselected);
if ($countrycode == 'us') $label = preg_replace('/\s*\(.*\)/', '', $label);
$out .= '<a href="'.$url.$languagecodeselected.'"><li><img height="12px" src="medias/image/common/flags/'.$countrycode.'.png" style="margin-right: 5px;"/>'.$label;
$out .= '<a href="'.$url.substr($languagecodeselected, 0, 2).'"><li><img height="12px" src="medias/image/common/flags/'.$countrycode.'.png" style="margin-right: 5px;"/>'.$label;
$out .= '<span class="fa fa-caret-down" style="padding-left: 5px;" />';
$out .= '</li></a>';
}
@ -1431,7 +1431,7 @@ class Website extends CommonObject
$countrycode = strtolower(substr($languagecode, -2));
$label = $weblangs->trans("Language_".$languagecode);
if ($countrycode == 'us') $label = preg_replace('/\s*\(.*\)/', '', $label);
$out .= '<a href="'.$url.$languagecode.'"><li><img height="12px" src="medias/image/common/flags/'.$countrycode.'.png" style="margin-right: 5px;"/>'.$label;
$out .= '<a href="'.$url.substr($languagecode, 0, 2).'"><li><img height="12px" src="medias/image/common/flags/'.$countrycode.'.png" style="margin-right: 5px;"/>'.$label;
if (empty($i) && empty($languagecodeselected)) $out .= '<span class="fa fa-caret-down" style="padding-left: 5px;" />';
$out .= '</li></a>';
$i++;