// Fix sprintf translation for theme and modules
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15015 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -121,7 +121,7 @@ class TranslateCore
|
||||
* @param string $source
|
||||
* @return string
|
||||
*/
|
||||
public static function getModuleTranslation($module, $string, $source)
|
||||
public static function getModuleTranslation($module, $string, $source, $sprintf = false)
|
||||
{
|
||||
global $_MODULES, $_MODULE, $_LANGADM;
|
||||
|
||||
@@ -176,6 +176,14 @@ class TranslateCore
|
||||
else
|
||||
$ret = stripslashes($string);
|
||||
|
||||
if ($sprintf)
|
||||
{
|
||||
if (!is_array($sprintf))
|
||||
$sprintf = array($sprintf);
|
||||
|
||||
$ret = vsprintf($ret, $sprintf);
|
||||
}
|
||||
|
||||
$lang_cache[$cache_key] = str_replace('"', '"', $ret);
|
||||
}
|
||||
return $lang_cache[$cache_key];
|
||||
|
||||
Reference in New Issue
Block a user