Plugin Author
TC.K
(@wp_dummy)
It’s depends on how you setup the WPML. Perhaps you should create different search form for non-default language page.
Thanks for your reply, TC.K. I did it as you said, I created two forms to be rendered in two different pages but constructed URL for searching give results only for default language, for non-default language there is no results at all.
I can explain it. For instance,
http://mydomain.com?unonce=5a8859a300&uformid=3474&s=uwpsfsearchtrg&taxo%5B0%5D%5Bname%5D=advanced_search_tax&taxo%5B0%5D%5Bopt%5D=3&taxo%5B0%5D%5Bterm%5D=articulos-propios-search-publicaciones&taxo%5B1%5D%5Bname%5D=category&taxo%5B1%5D%5Bopt%5D=3&taxo%5B2%5D%5Bname%5D=category&taxo%5B2%5D%5Bopt%5D=3&skeyword=España
where uformid is a custom query form for default language give results (“España” keyworded query string AND default-language category ).
And:
http://mydomain.com?unonce=5a8859a300&uformid=3514&s=uwpsfsearchtrg&taxo%5B0%5D%5Bname%5D=advanced_search_tax&taxo%5B0%5D%5Bopt%5D=3&taxo%5B0%5D%5Bterm%5D=articles-ahl-search-publications-fr&taxo%5B1%5D%5Bname%5D=category&taxo%5B1%5D%5Bopt%5D=3&taxo%5B2%5D%5Bname%5D=category&taxo%5B2%5D%5Bopt%5D=3&skeyword=Espagne
give no results.
But:
http://mydomain.com?lang=fr&unonce=5a8859a300&uformid=3514&s=uwpsfsearchtrg&taxo[0][name]=advanced_search_tax&taxo[0][opt]=3&taxo[0][term]=articles-ahl-search-publications-fr&taxo[1][name]=category&taxo[1][opt]=3&taxo[2][name]=category&taxo[2][opt]=3&skeyword=Espagne
YES, give results.
Is there any way to add lang=fr to URL for form rendered in a static page direct in plugin or maybe is this a question related WPML tags?
Hello again
I found a solution for this concrete problem by using ICL_LANGUAGE_CODE from WPML API directly in uwpqsf code.
In searchform.php inside html folder, I added this:
if(ICL_LANGUAGE_CODE==’es’):
echo ‘<input type=”hidden” name=”lang” value=”es” />’;
endif;
if(ICL_LANGUAGE_CODE==’fr’):
echo ‘<input type=”hidden” name=”lang” value=”fr” />’;
endif;
Maybe this is the dirtiest solution becasuse of modifying plugin code but by adding hidden filed in search form, it is solved.
Thank you for your plugin. I am very happy with it.
Congrats