[-] BO: Fix #PSCFV-6657 translations of overriden admin templates
This commit is contained in:
1 parent
1838003353
commit
f3000f6c65
1 file changed
+9
-2
@@ -57,7 +57,14 @@ function smartyTranslate($params, &$smarty)
|
|||||||
// If the tpl is used by a Controller
|
// If the tpl is used by a Controller
|
||||||
else
|
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);
|
$folder_tree = preg_split('#[/\\\]#', $filename);
|
||||||
$key = array_search('controllers', $folder_tree);
|
$key = array_search('controllers', $folder_tree);
|
||||||
|
|
||||||
@@ -69,8 +76,8 @@ function smartyTranslate($params, &$smarty)
|
|||||||
$class = 'Admin'.Tools::toCamelCase($folder_tree[0], true);
|
$class = 'Admin'.Tools::toCamelCase($folder_tree[0], true);
|
||||||
else
|
else
|
||||||
$class = null;
|
$class = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Translate::getAdminTranslation($params['s'], $class, $addslashes, $htmlentities, $sprintf);
|
return Translate::getAdminTranslation($params['s'], $class, $addslashes, $htmlentities, $sprintf);
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in new issue
Block a user