Page 1 of 1

Problem: Search module shows results in wrong language

Posted: Fri Nov 24, 2006 11:04 pm
by Marciux
I have a default 1.0.2 version installed and I am using the default Search module to search my site in two languages - English and Lithuanian.
The results are being displayed in two different pages (alias "search_en" and "search_lt"). The search forms are also configured to send data to these pages.

When I search the English version of site (with {search resultpage="search_en" lang="en_EN"} in content body), I have no problems. But when I try to search Lithuanian version of site ({search resultpage="search_lt" lang="lt_LT"}) I have a problem - search box appears correctly, but the results appear in English language.

The "Default language for the frontend" setting doesn't select any language for me. If I enter Lithuanian there, then all the search results (English ones also) are displays in Lithuanian language.

Result page (search_lt) uses Lithuanian template and I don't want to show an English words there... Any ideasĀ  ???

Hint: may be there is a possibility to pass different "Default language for the frontend" values for different pages or templates? That would help me I think.

Re: Problem: Search module shows results in wrong language

Posted: Wed Apr 07, 2010 3:27 pm
by manuel
I've been experiencing the same problem (but with cmsms 1.6.7 and search 1.6.1
I didn't understand why for one of my websites it was no problem to have the
search results page show in the correct language while for a different one
hosted on the same server, it seemed impossible!
I meticulously compared every piece of code used by the module! Well, not the
script itself but you know what I mean, the code generated as output and the
templates used by the search module, the permissions for the files and folders
on the server, the default front end language, the version number of the search
modules, ......... ;D, I even upgraded both sites to the latest version of cmsms
and reinstalled the search module (even though it was the same version).

Finally I've tried repositioning the search box to a different position in the
template and the problem was instantaneously fixed!!
As i wanted to keep the search box in the old location but the search box in the
new location was critical to make the search results appear in the correct
language, i tried to include both boxes in the template and hide one for the
visitors...

This is the code that worked for me:

Code: Select all

<div style="display:none;">{search lang="fr_FR"}</div>
<div id="contentMain">
<h1>{title}</h1>
{content}
</div>
{search lang="fr_FR"}
If anyone knows what's causing this behavior, i would love to hear from you!
Maybe a less ugly solution is possible?

Greetings,
Manuel