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 7 years, 5 months ago.
- AuthorPosts
- September 29, 2015 at 1:07 pm #6059
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
October 1, 2015 at 8:02 pm #6088Hi!
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 :)
October 3, 2015 at 10:09 am #6105Hi!
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.
Best,
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
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
October 3, 2015 at 10:24 am #6106Hi Ernest,
Thank you for coming back to me.
I am going to give it a try and let you know.
Thanks again,
David
October 3, 2015 at 10:33 am #6107Hi Ernest,
Success!!! It works perfectly.
Thank you so much.
Cheers
David
October 3, 2015 at 10:42 am #6108Great! 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 :)
October 3, 2015 at 10:55 am #6109Just 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
October 3, 2015 at 11:00 am #6110Yep, 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 :)
October 3, 2015 at 2:12 pm #6111Hi,
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
- AuthorPosts
You must be logged in to reply to this topic.