• Resolved mstudioIL

    (@mstudioil)


    My site is several languages. how to I make the search work in the right language?
    it is something the plugin do or it is some WordPress settings?
    I want the search to show the right results of each languages.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Nicolas Lecocq

    (@olympuswp)

    I can for sure look at it but the support here is limited as I can’t ask you for your login details to see what can be wrong. I never really used Polylang but as all the text included in the plugin can be translated, it is quite odd if you can’t with the plugin.

    Thread Starter mstudioIL

    (@mstudioil)

    I think I found what to do.
    The problem is with the form action always show the URL with the main language like domain-name.com and it missing the language code for other languages like domain-name.com/es or domain-name.com/pt when you are visiting these pages.
    The regular WordPress search is working with the language code, I checked the search and saw that it has the language code.
    I used some jQuery to check the html tag lang attribute and replace the URL that don’t had the language code with URL with the language code that match the lang attribute.
    I checked other menu plugin with search and they have the same problem.
    I found two solution about this topic
    this is from polylang
    https://polylang.pro/always-use-get_search_form-to-create-search-forms/
    and this from stackoverflow
    https://stackoverflow.com/questions/41788564/wordpress-multilingual-search-form-with-polylang

    I used something like the second and upload the searchform.php to the child theme

    Plugin Author Nicolas Lecocq

    (@olympuswp)

    Yes, if you do it via your child theme, it should work as expected ??
    Glad you’ve found a solution, don’t hesitate to reach me again for any issue, and if you like Zeus Elementor, please, think to rate it 5 stars when you will have some time, thanks a lot ??

    Thread Starter mstudioIL

    (@mstudioil)

    I not sure the searchform.php is working, is the widget search use this search?
    I think my custom JS is what is doing the job

    • This reply was modified 2 years, 11 months ago by mstudioIL.
    Plugin Author Nicolas Lecocq

    (@olympuswp)

    I’m an idiot, sorry ???♂?
    No the text comes from the plugin directly so yes, use JS for it seems the best thing to do until they solve the issue.

    Thread Starter mstudioIL

    (@mstudioil)

    Thanks ??

    Plugin Author Nicolas Lecocq

    (@olympuswp)

    You are most welcome ??
    Feel free to reach me again for anything ??

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Search icon and polylang’ is closed to new replies.