From 8505c5db09e82447c12f788d19bea6db9ce151ea Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 6 Jul 2016 13:26:49 +0200 Subject: [PATCH] Code comment --- htdocs/core/class/translate.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 06bd6dc0c40..9ca6196b018 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -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]
"; + //if ($domain == 'orders') print "Domain=$domain, found a string for $tab[0] with value $tab[1]. Currently in cache ".$this->tab_translate[$key]."
"; + //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]."
"; 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
"; if ($usecachekey) $tabtranslatedomain[$key]=$value; // To save lang content in cache } }