Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Gtranslate in ajax search shows not the translated search results
- This topic has 3 replies, 2 voices, and was last updated 1 year, 6 months ago by
Ernest Marcinko.
-
AuthorPosts
-
November 22, 2024 at 11:29 am #51982
Matthias Trebus
ParticipantHej, we are using Gtranslate to translate our site. However it doesn´t show the translated search results. They say, the need the response from ajax search to be a JSON file, so they can translate it. So here is what the gtranslate support told us :
Our system can translate search results if Ajax-search-pro plugin chnages the structure of the response from their side.
Currently, they are responding with content-type: text/plain header.
They use custom formats, not standard internal ones (ASPEND_HTML, ASPSTART_DATA).
We need to write special code to support them.
They need to make their AJAX response format HTML, JSON, or HTML + JSON defined in script tags with application/JSON type.
If they don’t support it, you might try using a different search plugin.You can reach out to me in our business time form 9 – 5 am or per mail [email protected].
We can´t provide FTP Access until you connected with us personally.
Best regards and thx in advance,
Matthias Trebus | betterwood.deNovember 22, 2024 at 11:53 am #51983Ernest Marcinko
KeymasterHi 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.
November 27, 2024 at 10:32 am #52081Matthias Trebus
ParticipantHi Ernest, thanks a lot.
You were right, it did the trick. We have translated search results with gtranslate and your Plugin on our site now.
Thanks a lot and take care,
Best regards,
Matthias Trebus | betterwood.deNovember 27, 2024 at 11:15 am #52082Ernest Marcinko
KeymasterYou cannot access this content.
-
AuthorPosts
- You must be logged in to reply to this topic.