Social share translation hover text

Hi there,

i found a post in the old forum and would have answered there. Now here i go:

I would like to translate the Hover Text of the Social Share Buttons. I have already put this into the child themes function.php

add_filter(‘ngettext’, ‘translate_text’ );
add_filter(‘gettext’, ‘translate_text’ );
function translate_text($translated) {
$translated = str_ireplace(‘Kommentar’, ‘reactie’, $translated);
$translated = str_ireplace(‘Kommentare’, ‘reacties’, $translated);
$translated = str_ireplace(‘Auf Facebook teilen’, ‘Deel via Facebook’, $translated);
$translated = str_ireplace(‘Auf Twitter teilen’, ‘Deel via Twitter’, $translated);
$translated = str_ireplace(‘Auf Google+ teilen’, ‘Deel via Google+’, $translated);
$translated = str_ireplace(‘Auf LinkedIn teilen’, ‘Deel via LinkedIn’, $translated);
$translated = str_ireplace(‘Auf Pinterest teilen’, ‘Deel via Pinterest’, $translated);
$translated = str_ireplace(‘Auf Reddit teilen’, ‘Deel via Reddit’, $translated);
$translated = str_ireplace(‘Via Email teilen’, ‘Deel via Email’, $translated);
return $translated;
}

Do need to translate the text also elsewhere? Is there a way simpler way?

Kind regards,

Atahualpa

Hey Atahualpa,

Thanks for writing in! The code above is the other way to translate the text. The easiest one would be to use a 3rd party translation plugin. You may use WPML or LocoTranslate plugin. This should work in most of our X theme users. You can also manually translate X by using x.pot file. For more detailed information, please check it out here: https://theme.co/apex/forum/t/setup-translation/61/1

Hope this helps.

Thanks for the info. I hope it was going to be this easy.

Hey,

You are welcome :slight_smile: