Answer the question
In order to leave comments, you need to log in
How to finally solve the final question with translations in Wordpress?
I would not like new holivars about Loco Translate and Say What. I want gettext pulp.
How to replace a single line without variables is approximately clear:
function my_text_strings( $translated_text, $text, $domain ) {
switch ( $translated_text ) {
case 'Отправить комментарий' :
$translated_text = __( 'Ругать', 'psycopypsycopy' );
break;
case 'Ответить' :
$translated_text = __( 'Ответочка', 'psycopypsycopy' );
break;
case 'Поиск' :
$translated_text = __( ' ', 'psycopypsycopy' );
break;
}
return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
<a href=\"%1$s\" aria-label=\"%2$s\">Вы вошли как %3$s</a>. <a href=\"%4$s\">Выйти?</a>
And this is logical, albeit pichyalno. How to get rid of pichal? What would the correct construction look like for something like this? Answer the question
In order to leave comments, you need to log in
Looking for a translation plugin?
Try the banal qTranslateX, just be careful there is a conflict with the ACF version, like either ACF or a plugin you need to install the previous version. There, the text can be translated literally in code: the condition will be something likeif (site = 'ru') echo "привет"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question