Skip to content
Snippets Groups Projects
Commit 608fa5ea authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Avoid to load language when we can not.

parent 81f0d953
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,12 @@ class Translate
if ($alt < 1 && isset($langarray[1]) && strtolower($langarray[0]) == strtolower($langarray[1])) $alt=1;
if ($alt < 2 && strtolower($langofdir) == 'en_us') $alt=2;
if (empty($langofdir)) // This may occurs when load is called without setting the language and without providing a value for forcelangdir
{
dol_syslog("Error: ".get_class($this)."::Load was called but language was not set yet with langs->setDefaultLang(). Nothing will be loaded.", LOG_WARNING);
return -1;
}
foreach($this->dir as $keydir => $searchdir)
{
// Directory of translation files
......
......@@ -2811,7 +2811,7 @@ class Societe extends CommonObject
}
else // For backward compatibility
{
dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_WARNING);
dol_syslog("Your country setup use an old syntax. Reedit it using setup area.", LOG_ERR);
include_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
$country_code=getCountry($country_id,2,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore
$country_label=getCountry($country_id,0,$this->db); // This need a SQL request, but it's the old feature that should not be used anymore
......
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