2014-02-24 54 views
0

標籤我有以下的刺痛,我需要本地化翻譯本地化字符串裏面

<?php echo 'Click <a href="'. esc_url(get_permalink()) . '">here</a> to go and wacth the video.' ?> 

我的問題是在句子的中間部分<a href="'. esc_url(get_permalink()) . '">here</a>。我也嘗試打破它這樣

<?php printf(__('Click %s to go and wacth the video.', 'pietergoosen'), '<a href="'. esc_url(get_permalink()) . '">here</a>'); ?> 

這工作,但隨後<a>標籤內的字here無法翻譯。

任何建議,這可怎麼解決

回答

1

您可以將標籤分成兩個單獨的字符串:

printf(__('Click %shere%s to go and wacth the video.', 'pietergoosen'), '<a href="'. esc_url(get_permalink()) . '">', '</a>');