[Resolved] Translate search bar from plugin Easy Property listings
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is using the Easy Property Listings plugin on a real estate website and is unable to translate search bar fields and the SEARCH button using WPML. The plugin is not fully compatible with WPML, and the strings are not available in the admin text strings section. Solution: We recommend trying two methods to locate and translate the missing strings: Method 1: Navigate to WPML > String Translation and enable the option 'Look for strings while pages are rendered' at the bottom of the page. Then, visit the page where the string appears, and return to WPML > String Translation to search for the string. Method 2: If the strings are not found, they might be registered as admin text strings. Follow the guide on finding and translating admin text strings here: https://wpml.org/documentation/getting-started-guide/string-translation/finding-strings-that-dont-appear-on-the-string-translation-page/. If these methods do not resolve the issue, we suggest contacting the plugin's support for further assistance or consider hiring a developer. Additionally, we recommend that the plugin developers join our 'Go Global' program to enhance compatibility: https://wpml.org/documentation/theme-compatibility/go-global-program/.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/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 at WPML support forum.
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.
Background of the issue:
I am currently working on a website for a real estate company by using the plugin Easy Property Listings. I have translated nearly all of its content with WPML but can't find the way of translating its search bar fields and SEARCH button. The website is available in 4 languages. I am using the hidden link documentation, but the only option provided there is to use POEdit. I would rather work with WPML.
Symptoms:
Part of the search bar fields are in Spanish and part in English. I need to have on each language version of the website all the fields in the same language, being the corresponding language of the website.
Questions:
How can I translate the search bar fields and SEARCH button of the Easy Property Listings plugin using WPML?
This plugin has a custom function for defining and using labels. That's why the strings are not translated on the front end. I will share some steps that you can try, which might help you find those strings and translate them, but I can't guarantee that it will work. If it doesn't, please contact the plugin support, consult them regarding the issue, and let us know their findings.
Here are the steps that I mentioned I would share with you:
The proper way to translate strings depends a lot on how they have been implemented inside the theme/plugin. Please try both methods and see if any of them resolve the issue.
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 to the front end to a page where you have that string showing up. After that, go back to WPML > String Translation, search for that string, and see if it now shows up.
Hi! I have tried what you said, but, unfortunately, the strings are not available in the admin text strings. Is there another way I could access those, please?
Thank you!
Gladys
As I mentioned in my last reply, if the workaround I recommended doesn't work, you will need to contact their support and consult them regarding the issue as this plugin is known to have compatibility issues with WPML.
this is what Easy Property Listings has replied, reply below. How can we update the function below to make it work for WPML so that WPML can fetch the remaining strings pending of translation, ?
We have used the gettext filter before with woocommerce that the gettext can be used to filter any plugin/theme on the site as all text gets passed through that filter.
So i guess you can adapt it to handle EPL text.
But we do not have access to your site and this issue is a bit more complex than what the support license is for.
function rec_epl_translate( $translated, $untranslated, $domain ) {
// copy me
case '[Order #%s]':
$translated = __('[Enquiry #%s]', 'woocommerce');
break;
// copy me
case '_xxx_':
$translated = __('_xxx_', 'woocommerce');
break;
}
//echo '<pre>';
//var_dump( $translated );
//echo '</pre>';
}
return $translated;
}
add_filter( 'gettext', 'rec_epl_translate', 9999, 3 );
This is an updated function, im just not sure of the function that WPML uses to handle the translation for each language.
Ie you could do a function to check the WPML for the current language (not sure what function)
function rec_epl_translate( $translated, $untranslated, $domain ) {
I really don't pass the "ball" around but, as they are mentioning that "the issue is a bit more complex than what the support license is for", I will have to mention the same thing once again, as I already mentioned above: these type of situations require custom coding which falls out of the purpose of our WPML Support Policy.
As I mentioned, this plugin is known to have issues with WPML and their developers can join our 'Go Global' program (https://wpml.org/documentation/theme-compatibility/go-global-program/), where our Compatibility developers will help them make their product 100% compatible with WPML for free.
But unfortunately, we are not able to create fixes or workarounds for any plugin on the market that is not fully compatible with WPML. As much as we would like to be able to do that, there are tens of thousands of WPML customers that use thousands of different plugins so that would be impossible to handle for every situation.