Today, I pushed through an updated to Contextual Related Posts and Top 10. Both of these are relatively minor updates.

Change of Text Domain

The biggest change in this version for both plugins is the renaming of the language files to use the plugins slug i.e. contextual-related-posts and top-10 respectively. This is in response to the new translation system announced by WordPress.org that will help plugin authors make their plugins available in more languages. The new system also enables more users and contributors to get involved with the translation process.

In order to make both these plugins compatible with the new system, the slugs for translation (i.e. the text-domain) had to be changed. If you’ve created your own translation files, then you will need to rename the name of the translation file which would have started with crp and tptn to the new text domains.

Additionally, the WordPress translation team would also assist in the translations of the plugin strings. Currently, both plugins have their translations set up on WP-Translations which I plan on continuing to use.

WPML support

The other main change across both plugins is the improved support for WPML. Most users have asked for support for WPML and thanks to the WPML team which gave me access to a test version of the plugin, I have been able to implement WPML support for both Contextual Related Posts and Top 10.

By default Contextual Related Posts will first check if the related post exists in the same language of the site your browsing and if not, then it will pull the default language. In the case of Top 10, only same language posts will be displayed in the top posts list. e.g. if your main blog language is English and the user is currently on the French version of your site, then Contextual Related Posts will display related posts in the mix of French and English. Top 10 will only display the top French posts, so even if you have more popular English posts, then these will not be shown.

You can change the behaviour of whether to include different language posts or just the same language by adding this code to your theme’s functions.php file.

https://gist.github.com/ajaydsouza/9b1bc56cec79295e784c#file-same-language-php

No more hash tags

In Contextual Related Posts, the id attribute has been removed from the related posts HTML output to make it W3C compliant. If you’re using the id with your custom styles, please change this to classes i.e. change #crp_related to .crp_related and it should work

Support, etc.

As usual, if you got a support query, then please create a new post at the Contextual Related Posts support forum or the Top 10 support forum as might be the case. Alternatively, I also offer paid email support on an hourly basis.