wordpress+相册+时间轴/seo教学平台
Prestashop为此提供了一个未记录的解决方案:
您可以在{l}函数调用中添加tags参数.此参数的值是一个字符串数组.要在字符串中添加此数组中的标记,您需要使用[i] x [/ i](其中i是从1开始的数组中的标记索引,x是要由标记包围的文本)
例如,如果我想在单个翻译行中呈现此字符串:
Welcome Florian Lemaitre!
我可以使用这段代码:
{l s='[1]Welcome[/1] [2]%s[/2]!' sprintf=[$name] tags=['', '']}
在您的情况下,您可以使用:
{l s="se stai inserendo un indirizzo per consegna all'interno dell'area [1]EXPO[/1]" tags=['']}
您可以在文件类/ Translate.php中找到相关代码:
/**
* Perform operations on translations after everything is escaped and before displaying it
*/
public static function postProcessTranslation($string, $params)
{
// If tags were explicitely provided, we want to use them *after* the translation string is escaped.
if (!empty($params['tags'])) {
foreach ($params['tags'] as $index => $tag) {
// Make positions start at 1 so that it behaves similar to the %1$d etc. sprintf positional params
$position = $index + 1;
// extract tag name
$match = array();
if (preg_match('/^\s*
$opener = $tag;
$closer = ''.$match[1].'>';
$string = str_replace('['.$position.']', $opener, $string);
$string = str_replace('[/'.$position.']', $closer, $string);
$string = str_replace('['.$position.'/]', $opener.$closer, $string);
}
}
}
return $string;
}