您可以将译文包装在printf 作用printf (或sprintf 当您不想立即打印到屏幕上时)允许您在字符串中放置占位符。请参阅所有类型说明符的文档
使用\\uuuu()而不是\\u e(),因为printf已经输出到屏幕。
$no_people = 5;
printf( __( \'There are %d <span>people</span> in this country.\', \'textdomain\' ), $no_people );
<小时>
Edit
为wp\\u localize\\u脚本添加了示例
$no\\U人数=5人;
$nostores = sprintf( __( \'There are %d <span>people</span> in this country.\', \'textdomain\' ), $no_people );
wp_localize_script( \'store-locator\', \'storelocatorjstext\', array(
\'nostores\' => $nostores
) );