Home › Forums › Product Support Forums › Related Posts Pro for WordPress Support › Translations WPML – Related Posts
- This topic has 8 replies, 2 voices, and was last updated 10 years, 8 months ago by
Slickbear.
-
AuthorPosts
-
September 29, 2015 at 1:07 pm #6059
Slickbear
ParticipantHi,
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 #6088Ernest Marcinko
KeymasterHi!
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.
October 3, 2015 at 10:09 am #6105Ernest Marcinko
KeymasterHi!
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:
[code]<?php if (isset($options["title_text"]) && $options["title_text"] != ""): ?>
<legend><?php echo $options["title_text"]; ?></legend>
<?php endif; ?>[/code]Change that code to something like:
[code]<?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; ?>[/code]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: http://i.imgur.com/CpBCnA2.pngOctober 3, 2015 at 10:24 am #6106Slickbear
ParticipantHi 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 #6107Slickbear
ParticipantHi Ernest,
Success!!! It works perfectly.
Thank you so much.
Cheers
David
October 3, 2015 at 10:42 am #6108Ernest Marcinko
KeymasterGreat! 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!
October 3, 2015 at 10:55 am #6109Slickbear
ParticipantJust 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 #6110Ernest Marcinko
KeymasterYep, it’s not there unfortunately, because it’s a get-around solution yet 🙂
Just change the text in the source code like so:
[code]<?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; ?>[/code]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.
October 3, 2015 at 2:12 pm #6111Slickbear
ParticipantHi,
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
- The forum ‘Related Posts Pro for WordPress Support’ is closed to new topics and replies.