[-] BO : fixed #PSFV-727 (issue #4)

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14481 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-04-05 10:06:17 +00:00
parent 6f8db8b2e8
commit 33ac5b0b33
6 changed files with 3820 additions and 4195 deletions
+10 -1
View File
@@ -39,7 +39,7 @@ class TranslateCore
* @param bool $htmlentities
* @return string
*/
public static function getAdminTranslation($string, $class = 'AdminTab', $addslashes = false, $htmlentities = true)
public static function getAdminTranslation($string, $class = 'AdminTab', $addslashes = false, $htmlentities = true, $sprintf = false)
{
static $modules_tabs = null;
@@ -73,6 +73,15 @@ class TranslateCore
$str = Translate::getGenericAdminTranslation($string, $key, $_LANGADM);
$str = $htmlentities ? htmlentities($str, ENT_QUOTES, 'utf-8') : $str;
if ($sprintf)
{
if (!is_array($sprintf))
$sprintf = array($sprintf);
$str = vsprintf($str, $sprintf);
}
return str_replace('"', '"', ($addslashes ? addslashes($str) : stripslashes($str)));
}