Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1091757
    Ying-Fu Li
    Participant

    Hi,

    I keep getting translation issues with X/WordPress. On this site: http://www.keyfactor.nl/inspiratie-blog-digital-projectmanager-pieter-kramer/ I have added my nl_NL.po file but still one word won’t get translated: ‘COMMENTS’ at the top of the post excerpt.

    Yes, I know how to edit .po-files and done that. Yes, I tried several ‘solutions’ on the forum. The damn word is here to stay. Please help! 😉

    Thanks guys!

    #1091785
    Lely
    Moderator

    Hello There,

    Thanks for posting in and we’re sorry you’re having this issue. Please try adding the following code on your child theme’s functions.php file:

    add_filter('gettext', 'translate_text' );
    function translate_text($translated) { 
      $translated = str_ireplace('Comment', 'Comment translation here', $translated);
      $translated = str_ireplace('Comments', "Comments translation here", $translated);
      return $translated; 
    }
    

    Hope this helps.

    #1091937
    Ying-Fu Li
    Participant

    Hi,

    Sorry, nothing changed.

    #1092006
    Darshana
    Moderator

    Hi there,

    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.

    #1092024
    Ying-Fu Li
    Participant
    This reply has been marked as private.
    #1092049
    Thai
    Moderator

    Hi There,

    I updated the provided code to this:

    add_filter('ngettext', 'translate_text' );
    function translate_text($translated) { 
      $translated = str_ireplace('Comment', 'reactie', $translated);
      $translated = str_ireplace('Comments', 'reacties', $translated);
      return $translated; 
    }

    Everything is working fine now.

    Cheers!!!

    #1096780
    Ying-Fu Li
    Participant

    Thanks. So just changed ‘gettext’ to ‘ngettext’?

    #1096855
    Paul R
    Moderator

    Yes. Kindly refer to the link below for more information.

    ngettext

    Hope that helps

    #1098682
    Ying-Fu Li
    Participant

    Ah, thanks!

    #1098751
    Prasant Rai
    Moderator

    You are most welcome. 🙂

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