admin管理员组文章数量:1198811
I am translating a site with Polylang that was created by someone else using a custom theme. Some strings couldn't be found by Polylang, so I need to manually register them for Polylang to see.
Now, some of the strings were pretty easy to translate using __()
:
$args = shortcode_atts([
'link' => 'service',
'text' => __('Get the code now!'),
'title' => __('Code'),
'id' => '',
'class' => 'width300',
], $args, '' );
But I don't know how to translate strings in these scenarios:
$popup = do_shortcode('[popup id="110" link="vacancy" class="" title="Code" text="Get the code now!!" ]');
or here words Details, Close
$script = '
<script>
$(document).ready(function(){
btn = $(\'.add_vakan_info\'),
popup = $(\'.add_popup\');
btn.click(function(){
var block_info = $(this).closest(\'.vacancy\').find(\'.content\');
if(block_info.hasClass(\'active\')){
block_info.removeClass(\'active\');
$(this).html(\'Details <i class="las la-angle-down"></i>\');
}else{
block_info.addClass(\'active\');
$(this).html(\'Close <i class="las la-angle-up"></i>\');
}
})
popup.click(function(){
var text = $(this).closest(\'.vacancy\').find(\'.title\').text(),
form = $(\'.vacancy_name\');
form.val(text);
})
FileInput();
})
</script>';
or
else:
$html = '<h4>No vacancy </h4>';
or
<div class="content col">
<div class="sp-20"></div>
<h4>Description</h4>
'.$description.'
<div class="sp-20"></div>
<h4>Requirements</h4>
'.$requirements.'
<div class="sp-20"></div>
<h4>Conditions</h4>
'.$conditions.'
本文标签: How to implement () function in my theme39s php file
版权声明:本文标题:How to implement __() function in my theme's php file? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738523107a2092138.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论