// Improve performance

This commit is contained in:
rGaillard
2012-03-12 14:50:56 +00:00
parent 0a3ed0b9eb
commit 3d0ccb91eb
4 changed files with 19 additions and 11 deletions
+6 -1
View File
@@ -115,6 +115,7 @@ class TranslateCore
{
global $_MODULES, $_MODULE, $_LANGADM;
static $lang_cache = array();
static $translations_merged = array();
if ($module instanceof Module)
{
@@ -134,7 +135,11 @@ class TranslateCore
$file = $local_path.'/'.Context::getContext()->language->iso_code.'.php';
if (Tools::file_exists_cache($file) && include_once($file))
$_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE;
{
if (!isset($translations_merged[md5($file)]))
$_MODULES = !empty($_MODULES) ? array_merge($_MODULES, $_MODULE) : $_MODULE;
$translations_merged[md5($file)] = true;
}
$string = str_replace('\'', '\\\'', $string);