Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1357779

    Christopher
    Moderator

    Hi there,

    Please add following code in child theme’s functions.php file :

    add_filter('gettext', 'translate_text' );
    function translate_text($translated) { 
    $translated = str_ireplace('Share on Facebook', 'Deel via Facebook', $translated);
    $translated = str_ireplace('Share on Twitter', 'Deel via Twitter', $translated);
    $translated = str_ireplace('Share on Google+', 'Deel via Google+', $translated);
    $translated = str_ireplace('Share on LinkedIn', 'Deel via LinkedIn', $translated);
    $translated = str_ireplace('Share on Pinterest', 'Deel via Pinterest', $translated);
    $translated = str_ireplace('Share on Reddit', 'Deel via Reddit', $translated);
    $translated = str_ireplace('Share via Email', 'Deel via Email', $translated);
    return $translated; 
    }

    Hope it helps.

    #1357977

    nbruell
    Participant

    Dear Christopher,

    thanks! That is a smart and easy way to solve the translation issue. I translated all I need at the moment. So thank you very much for that!
    On the other hand I would like to know why the “wordpress” idea with the .po files does not work, to get a deeper understanding!

    So if anybody could help / explain that, I would realy appreciate it!

    kind regards, Norbert

    #1358266

    Rad
    Moderator

    Hi there,

    Maybe it’s due to text domain or cache. This code works since it will ignore other unknown restrictions.

    Cheers!