[-] BO: Fix #PSCFV-6657 translations of overriden admin templates

This commit is contained in:
Rémi Gaillard
2013-06-10 18:23:59 +02:00
parent 1838003353
commit f3000f6c65
+10 -3
View File
@@ -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);
}
}