Translate the reply button in the comments

I am starting to hate this. The translation strings don’t work for all elements always. There has been a translation issue in X theme since years. I doubt this will ever be fixed since not many people complain and even if they do, they are shared a snippet which works, but that snippet too won’t work for all the text. Anyways, I am unable to translate the word Reply in the comment form. I have shared the link in private

Hi There,

Please try adding this custom code under functions.php file locates in your child theme:

add_filter('gettext', 'translate_texts');
function translate_texts($translated) { 
	$translated = str_ireplace('Reply <span class="comment-reply-link-after"><i class="x-icon-reply" data-x-icon-s="&#xf3e5;"></i></span>', 'Your text <span class="comment-reply-link-after"><i class="x-icon-reply" data-x-icon-s="&#xf3e5;"></i></span>', $translated);
	return $translated; 
}

Don’t fotget to replace the Your text text with yours.

Hope it helps :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.