Function – string translation
-
Hey,
first of all – thank you for this awesome plugin ??
I have some issue with translating my page. I can’t translate some strings (ex. text on buttons). I tried to register those strings with function and then translate them but nothing happened. Next I try to translate them in .po file but again – nothing happened.
Finally, I used this function to get those text translated:
function change_translate_text( $translated_text ) { if ( $translated_text == 'View' ) { $translated_text = 'new text'; } return $translated_text; } add_filter( 'gettext', 'change_translate_text', 20 );
Unfortunatelly, I have 3 languages on my site and I need some help with this code – it should detect user language and then display correct translation. I was trying to add:
$curlang = pll_current_language(); if ($curlang=='ru')
but this also didn’t work.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Function – string translation’ is closed to new replies.