[-] BO: Fix #PSCFV-6657 translations of overriden admin templates
This commit is contained in:
@@ -57,7 +57,14 @@ function smartyTranslate($params, &$smarty)
|
||||
// If the tpl is used by a Controller
|
||||
else
|
||||
{
|
||||
// Split by \ and / to get the folder tree for the file
|
||||
if (isset(Context::getContext()->controller))
|
||||
{
|
||||
$class_name = get_class(Context::getContext()->controller);
|
||||
$class = substr($class_name, 0, strpos(Tools::strtolower($class_name), 'controller'));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Split by \ and / to get the folder tree for the file
|
||||
$folder_tree = preg_split('#[/\\\]#', $filename);
|
||||
$key = array_search('controllers', $folder_tree);
|
||||
|
||||
@@ -69,8 +76,8 @@ function smartyTranslate($params, &$smarty)
|
||||
$class = 'Admin'.Tools::toCamelCase($folder_tree[0], true);
|
||||
else
|
||||
$class = null;
|
||||
}
|
||||
}
|
||||
|
||||
return Translate::getAdminTranslation($params['s'], $class, $addslashes, $htmlentities, $sprintf);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user