[Resolved] Translate text inserted by Ad Inserter plugin
This thread is resolved. Here is a description of the problem and solution.
Problem: The client needed assistance with translating text inserted by the Ad Inserter plugin under the first image on every post. Solution: We informed the client that the Ad Inserter plugin saves data in the wp_option table but encoded, which makes it difficult to translate using the standard WPML String Translation method. We suggested two solutions: 1. We recommended inviting the plugin author to join our Go Global program so we can collaborate on making the plugin compatible with WPML. 2. As a workaround, we advised using a WPML shortcode to make the text translatable. The client should insert the following shortcode into the Ad Inserter:
[wpml-string context="ad-textdomain" name="ad-text1"]Some text to add as ad text[/wpml-string]
Afterward, the client can translate the text via WPML String Translation.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If so, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket with us.
100% of people find this useful.
This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
We are using the Ad Inserter plugin https://wordpress.org/plugins/ad-inserter/ to insert a basic disclosure under the first image on every post. We still cannot find where to translate the text inserted by the plugin.
Before this ticket gets assigned to my colleagues, I will try to help.
The proper way to translate strings depends a lot on how they have been implemented inside the theme/plugin.
IMPORTANT: Sometimes, there are even duplicates of the same string and only one of them is the correct one that needs to be translated.
Also, sometimes, simply removing the string (checking the box and removing it) and then re-registering it again by scanning for it (one of the methods below) and re-translating it resolves the issue (sounds like you did this already so let's focus on finding the duplicates that are still NOT translated).
1. Method 1:
Go to WPML > String Translation and at the bottom of the page you will find a checkbox called "Look for strings while pages are rendered". You can enable (check) that and then go in the front end to a page where you have that string showing up and then go back to WPML > String Translation and search for that string and see if it now shows up.
2. Method 2: If you can't find them inside the WPML > String Translation, they might be added as admin text.
Basically, Ad Inserter is adding this text dynamically on page load, in other words, you don't see it when in the post editor.
I have tried the methods described in point 1 and couldn't find anything. I am still working through what is described in method 2 to identify the type of string it is, if it is even a string.
I have checked and it seems the AD Inserter saves the data in wp_option table but encoded, so even if you follow our guide for translation admin texts (WPML > String Translation > Translate texts in admin screens), I do not it would be much of help for you.
Since I do not see this plugin on our official plugin list, I advise inviting the author to our GoGLobal and we would be glad to help and work together in making the plugin compatible with WPML.
Thank you, that little workaround with short code worked perfectly! And it will continue to do so for the foreseeable future, considering our current simple use of the Ad Inserter plugin. But perhaps I will get in touch with plugin author about WPML compatibility.