Translate [share] shortcode

Hi there,

I have an issue regarding the translation of the [share] shortcode. I have already translated the x child theme, it worked very well. Now I tried to translate also the text of [share] and the text still appears in english in the tooltips. I added translations to the de_DE.po file and uploaded it and the .mo file back to the /x-child/languages folder. Do you have any idea what could be going wrong?

Many thanks in advance!

Hi David,

If it is not working for you, you can do it manually via the code. Please kindly install the Child Theme and add the code below to functions.php file:

function custom_text_translate($translated) { 
	$translated = str_ireplace('Share on Twitter', 'GERMAN', $translated);
	$translated = str_ireplace('Share on Facebook', 'GERMAN', $translated);

	return $translated; 

add_filter('gettext', 'custom_text_translate' );

The code above changes Share on Twitter to GERMAN. and Share on Facebook to GERMAN. You can change GERMAN to whatever you like, you can do the same for other share icons too.

Kindly, read the last part of this article for more information.

Thank you.

Thank you, I will translating it this way then.

You’re welcome.

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