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

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

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #51982
    Matthias TrebusMatthias Trebus
    Participant

    Hej, 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.de

    #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.

    #52081
    Matthias TrebusMatthias Trebus
    Participant

    Hi 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.de

    #52082
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.