Translations WPML – Related Posts

Home Forums Product Support Forums Related Posts Pro for WordPress Support Translations WPML – Related Posts

This topic contains 8 replies, has 2 voices, and was last updated by Slickbear Slickbear 8 years, 7 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #6059
    Slickbear
    Slickbear
    Participant

    Hi,

    My site is using WPML and I have Related Posts Pro installed.
    I need to know how I can translated the title above the related posts i.e. “Related Posts”

    I have searched your site and documentation and cannot find it.

    Thanks

    David

    #6088
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    It’s not yet possible. Tomorrow when I get back to office I look up a solution to hard-code something translatable there for you.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #6105
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi!

    I looked up all possible solution based on this WPML article.

    Method 2 and 3 are the possibilities, probably method 2 is easier in our case. This means that the title must be hard coded and then translated on the WPML string translations interface.

    Open up the wp-content/plugins/related-posts-pro/includes/views/rpp.shortcode.php file and go lines 15-17, where you should see this:

    <?php if (isset($options["title_text"]) && $options["title_text"] != ""): ?>
        <legend><?php echo $options["title_text"]; ?></legend>
    <?php endif; ?>

    Change that code to something like:

    <?php if (isset($options["title_text"]) && $options["title_text"] != ""): ?>
        <?php icl_register_string('related_posts_pro', 'Header title', 'Related Posts'); ?>
        <legend><?php echo icl_t('related_posts_pro', 'Header title', 'Related Posts'); ?></legend>
    <?php endif; ?>

    Now, refresh one of the frontend pages where the Related Posts Pro plugin is active a few times to get this string registered.
    Then if you open the string translations submenu on WPML, you should be able to see this string and translate it: https://i.imgur.com/CpBCnA2.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #6106
    Slickbear
    Slickbear
    Participant

    Hi Ernest,

    Thank you for coming back to me.

    I am going to give it a try and let you know.

    Thanks again,

    David

    #6107
    Slickbear
    Slickbear
    Participant

    Hi Ernest,

    Success!!! It works perfectly.

    Thank you so much.

    Cheers

    David

    #6108
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Great! I will implement this as a feature to the upcoming version.

    If you like the plugin, feel free to rate it anytime on your codecanyon downloads page.

    Feel free to contact me if you need any help, have a nice day!

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #6109
    Slickbear
    Slickbear
    Participant

    Just one other question, how could I change the English “Related Posts” to something for example: “Recommended for you”
    I didn’t see anything in the management console.

    I will definitely give you a great rating on Codecanyon

    #6110
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Yep, it’s not there unfortunately, because it’s a get-around solution yet 🙂

    Just change the text in the source code like so:

    <?php if (isset($options["title_text"]) && $options["title_text"] != ""): ?>
        <?php icl_register_string('related_posts_pro', 'Header title', 'Recommended for you'); ?>
        <legend><?php echo icl_t('related_posts_pro', 'Header title', 'Recommended for you'); ?></legend>
    <?php endif; ?>

    As you can see there is two ‘Recommended for you’ strings there between apostrophes, that’s the default english text. Change that to anything you want. Once you are done, only then start translating, because I’m not sure if changing the text looses the translations or not.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #6111
    Slickbear
    Slickbear
    Participant

    Hi,

    I changed it and then in WPML the translations were there, I simply needed to check “translation completed” and save for each language and it worked perfectly.

    Thanks for the great support.

    David

Viewing 9 posts - 1 through 9 (of 9 total)

The forum ‘Related Posts Pro for WordPress Support’ is closed to new topics and replies.