Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1059925
    GeorgDick
    Participant

    Hello,

    my name is Georg Dick. I am using x Theme on my website phaenomen.net.
    How can I translate these texts without changing the function.php?

    Thank you for your answer.

    Kind regards.

    Georg Dick

    #1059965
    Christopher
    Moderator

    Hi there,

    Thanks for writing in!

    If you’re referring sharing options in portfolio page, you need to translate strings in x.pot file, to do so follow this link https://community.theme.co/kb/translation

    If you’re referring to social sharing shortcodes, this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

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

    add_filter('gettext', 'translate_text', 20 );
    function translate_text($translated) { 
      $translated = str_ireplace('Share on Facebook', 'Your new text 1', $translated);
      $translated = str_ireplace('Share on Twitter', 'Your new text 2', $translated);
      $translated = str_ireplace('Share on Google+', 'Your new text 3', $translated);
      $translated = str_ireplace('Share on LinkedIn', 'Your new text 4', $translated);
      $translated = str_ireplace('Share via Email', 'Your new text 5', $translated);
      return $translated; 
    }

    Hope it helps.

    #1063138
    GeorgDick
    Participant
    This reply has been marked as private.
    #1063167
    Christopher
    Moderator

    Hi there,

    #1 No, it’s not possible.

    #2 Sorry, no it breaks your site.

    Thanks.

    #1068623
    GeorgDick
    Participant
    This reply has been marked as private.
    #1068626
    GeorgDick
    Participant
    This reply has been marked as private.
    #1068917
    Friech
    Moderator

    Hi Georg,

    #2 The code will be overwritten when you update the parent theme. So to keep the code use a child theme.

    Social Sharing element provide you a input field for that.


    screenshot

    Thanks.

    #1071327
    GeorgDick
    Participant

    Thank you.
    The screenshot you mention is to find within cornerstone? But I don’t use cornerstorne. I work in the text modus.
    What to do? Thank you for your guidance.
    Georg Dick

    #1071384
    Paul R
    Moderator

    Hi,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password
    – FTP credentials

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    #1071534
    GeorgDick
    Participant
    This reply has been marked as private.
    #1071592
    Joao
    Moderator

    Great to hear it Georg.

    Let us know if you need help with anything else.

    Joao

    #1074479
    GeorgDick
    Participant

    Thank you Joao. I think we can close the ticket for now.

    #1074564
    Paul R
    Moderator

    You’re welcome! 🙂

  • <script> jQuery(function($){ $("#no-reply-1059925 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>