How to implement Polylang functions in my theme's php file?
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 = 'h4No vacancy /h4';
or
div class=content col
div class=sp-20/div
h4Description/h4
'.$description.'
div class=sp-20/div
h4Requirements/h4
'.$requirements.'
div class=sp-20/div
h4Conditions/h4
'.$conditions.'
Topic plugin-polylang translation functions php Wordpress
Category Web