// Fix translation behavior
This commit is contained in:
@@ -920,9 +920,7 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
foreach ($matches as $key)
|
foreach ($matches as $key)
|
||||||
{
|
{
|
||||||
$md5_key = md5($key);
|
$md5_key = md5($key);
|
||||||
$module_key = null;
|
$module_key = '<{'.Tools::strtolower($module_name).'}'.strtolower($theme_name).'>'.Tools::strtolower($template_name).'_'.$md5_key;
|
||||||
if ($theme_name)
|
|
||||||
$module_key = '<{'.Tools::strtolower($module_name).'}'.strtolower($theme_name).'>'.Tools::strtolower($template_name).'_'.$md5_key;
|
|
||||||
$default_key = '<{'.Tools::strtolower($module_name).'}prestashop>'.Tools::strtolower($template_name).'_'.$md5_key;
|
$default_key = '<{'.Tools::strtolower($module_name).'}prestashop>'.Tools::strtolower($template_name).'_'.$md5_key;
|
||||||
// to avoid duplicate entry
|
// to avoid duplicate entry
|
||||||
if (!in_array($module_key, $array_check_duplicate))
|
if (!in_array($module_key, $array_check_duplicate))
|
||||||
@@ -930,13 +928,13 @@ class AdminTranslationsControllerCore extends AdminController
|
|||||||
$array_check_duplicate[] = $module_key;
|
$array_check_duplicate[] = $module_key;
|
||||||
if (!isset($this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad']))
|
if (!isset($this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad']))
|
||||||
$this->total_expression++;
|
$this->total_expression++;
|
||||||
|
if ($theme_name && array_key_exists($module_key, $GLOBALS[$name_var]))
|
||||||
if ($module_key && array_key_exists($module_key, $GLOBALS[$name_var]))
|
|
||||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$module_key], ENT_COMPAT, 'UTF-8');
|
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$module_key], ENT_COMPAT, 'UTF-8');
|
||||||
elseif (array_key_exists($default_key, $GLOBALS[$name_var]))
|
elseif (array_key_exists($default_key, $GLOBALS[$name_var]))
|
||||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$default_key], ENT_COMPAT, 'UTF-8');
|
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = html_entity_decode($GLOBALS[$name_var][$default_key], ENT_COMPAT, 'UTF-8');
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
//d(array($module_key, $default_key, $key, $GLOBALS[$name_var]));
|
||||||
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = '';
|
$this->modules_translations[$theme_name][$module_name][$template_name][$key]['trad'] = '';
|
||||||
$this->missing_translations++;
|
$this->missing_translations++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user