Code comment
This commit is contained in:
parent
840601a491
commit
8505c5db09
@ -161,6 +161,7 @@ class Translate
|
||||
{
|
||||
global $conf,$db;
|
||||
|
||||
// Load $this->tab_translate[] from database
|
||||
if (count($this->tab_translate) == 0) $this->loadFromDatabase($db); // Nothing was loaded yet, so we load database.
|
||||
|
||||
// Check parameters
|
||||
@ -241,7 +242,7 @@ class Translate
|
||||
$tmparray=dol_getcache($usecachekey);
|
||||
if (is_array($tmparray) && count($tmparray))
|
||||
{
|
||||
$this->tab_translate+=$tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a valuer already exists into tab_translate, value into tmparaay is not added.
|
||||
$this->tab_translate+=$tmparray; // Faster than array_merge($tmparray,$this->tab_translate). Note: If a value already exists into tab_translate, value into tmparaay is not added.
|
||||
//print $newdomain."\n";
|
||||
//var_dump($this->tab_translate);
|
||||
if ($alt == 2) $fileread=1;
|
||||
@ -261,7 +262,8 @@ class Translate
|
||||
{
|
||||
$tab=explode('=',$line,2);
|
||||
$key=trim($tab[0]);
|
||||
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]<br>";
|
||||
//if ($domain == 'orders') print "Domain=$domain, found a string for $tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."<br>";
|
||||
//if ($key == 'Order') print "Domain=$domain, found a string for key=$key=$tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."<br>";
|
||||
if (empty($this->tab_translate[$key]) && isset($tab[1])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries)
|
||||
{
|
||||
$value=trim(preg_replace('/\\n/',"\n",$tab[1]));
|
||||
@ -278,6 +280,7 @@ class Translate
|
||||
else
|
||||
{
|
||||
$this->tab_translate[$key]=$value;
|
||||
//if ($domain == 'orders') print "$tab[0] value $value<br>";
|
||||
if ($usecachekey) $tabtranslatedomain[$key]=$value; // To save lang content in cache
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user