This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Gtranslate in ajax search shows not the translated search results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Gtranslate in ajax search shows not the translated search results Reply To: Gtranslate in ajax search shows not the translated search results

#51983
Ernest MarcinkoErnest Marcinko
Keymaster

Hi Matthias,

We have contacted gTranslate support a couple of months back, unfortuntely they have no API, or any way to trigger translations, nor any way to access them. What I have been told is that the plugin acts only as a proxy to the translation server.
It is very unfortunate, as we wanted to make the translations searchable, but since they are not possible to access in any way, it is not possible by any plugin to do it. We hope that they add some way to make that possible in the future.

The only way to do it right now is exactly what they suggest.

Try adding this code via the Code Snippets plugin or to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

add_filter('asp/ajax/headers/content_type', function($content_type) {
	return 'text/html';
});

This should do the trick.