Issues on translating En in other languages

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Issues on translating En in other languages

This topic contains 7 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 8 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #45641
    doc
    doc
    Participant

    Hello,
    We have installef GTranslate for translations in other languages and we have some issues at translations the Ajax Search PRO section. Here is the link: https://docpro.doc.ro/patients/find-a-clinical-trial
    We are on the EN langauge but after we select Spanish language for example and from Conditions we select any of them the results bring us in English language in this situation GTranslate can not translate. It;s because the Content-Type is text/plain
    so is possible to helps us to change Content-Type from text/plain to application/json ?

    Attached 3 screenshots to better understanding.

    Best regards

    Attachments:
    You must be logged in to view attached files.
    #45651
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Sure, I can help you with that, but it requires changing one of the core files unfortuantely. I need to inform you that this change may have some negative effects, as the response body is not in json format, so the other plugin may encounter issues when trying to deserialize.

    To change the header type:
    – Open up the wp-content\plugins\ajax-search-pro\includes\classes\Hooks\Ajax\Search.php file on your server
    – Go to line 121, which should be this: Ajax::prepareHeaders();
    – Change it to: Ajax::prepareHeaders('application/json');
    – Save the file

    Now the responses from the live search are marked with the application/json header.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #45667
    doc
    doc
    Participant

    Hello,
    Thank you so much for your support. I’ve added the code on the line 121 but still text appears to be there. Attached screenshots
    You can test here aso: https://docpro.doc.ro/es/los-pacientes/encontrar-un-ensayo-cl%C3%ADnico

    Attachments:
    You must be logged in to view attached files.
    #45670
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    You are welcome!

    If you check the network panel, the response header is now application/json: https://i.imgur.com/LabH6Ux.png
    I suspect the translator requires actual JSON data to translate, but the data is not in JSON format. By changing the header will not change the data format to JSON.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #45706
    doc
    doc
    Participant

    Hello,
    I understand. We try to find another solution.
    I added in AJax Search selector post Category (Categories) (please see ajax1.png) on ​​this link: https://docpro.doc.ro/patients/find-a-clinical-trial. The problem is when we select for example Psoriatic Arthritis (see ajax2.png image attached) the problem is that when we select and click on Search the displayed results are all the categories that have posts (see attached image ajax3.png). How do I make it so that when a category is selected from the selector, for example Psoriatic Arthritis and then we click on the Search button, it redirects on the same tab or to the new tab directly to the Psoriatic Arthritis category (https://docpro.doc.ro/category/psoriatic-arthritis) not to all Categories how is happening now.

    Best regards

    Attachments:
    You must be logged in to view attached files.
    #45728
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    Okay – so make sure you don’t have any categories as results selected, filtering categories by categories has no effect: https://i.imgur.com/fRVtMUn.png
    Instead choose the posts to be returned based on the category filtering: https://i.imgur.com/zjU4RPG.png

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #45758
    doc
    doc
    Participant

    Hello,
    Thank you so much for your great support. Is there any possibility to set it in such a way that when we click in a selection it redirects to the post category for example https://docpro.doc.ro/category/psoriatic-arthritis to make other settings but these steps and the result

    Best regards,
    Alex

    #45762
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Alex,

    I’m afraid that may not be possible unfortunately. I would suggest a custom script to somehow make it happen, but unfortunately the filters only hold the category ID on the client side. To make a redirection to the category page that information is not sufficient, because in WordPress it is not possible to redirect to a term page via the term ID (as far as I know).

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.