// Fix sprintf translation for theme and modules

This commit is contained in:
lLefevre
2012-05-02 16:07:45 +00:00
parent e1ab29cfb7
commit b48a7a3676
4 changed files with 21 additions and 4 deletions
+9 -1
View File
@@ -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];