Today I looked at this problem again, and it dawned on me that the problem Sparrow had must be different than the problems I'm having, because his/her workaround attacks the module, the problems I'm having are in the search component
, not the module - it seems to be that either Joomfish doesn't fully handle the intricacies of the search results or there are design decisions I don't understand. (And oh, by the way, I updated both Joomla and Joomfish to the newest versions.) My problems happen regardless of whether I start the search in the module (I use YooSearch, but it doesn't matter), by doing an additional search directly in the component, or by doing a search and then switching viewing language while on the results page - the behavior is the same. So the module code is completely unrelated.
Permit me to include more explanation and screenshots - this post will be a bit long, but hopefully informative. (Scroll to the end if you want just the summary.)
English is my default language, Japanese the translated one. I'm using the standard Jooma SEO functionality, but I have tested this with SEO off and I get the same reaction. You are welcome to try this yourself at http://oicjapan.org
. Okay, first example: Let's say I'm looking at the site in Japanese, but I search on "Wednesday" (or I search on it and then switch to Japanese view while looking at the results page - it makes no difference which order I do it in). The search results page will look like this (I faked the mouse pointer image, but you get the idea):
It looks okay at first glance. But note the status bar at the bottom - the hyperlinks on the article titles all point to the Japanese version of the pages: "http://oicjapan.org/ja/..." (or without SEO, "http://oicjapan.org/index.php...lang=ja"), even though the word "Wednesday" only appears in English pages.
Next, we'll do the opposite, which highlights an additional problem. I'm looking at the site in English, and I search on the Japanese word for Wednesday. I get the following:
This page has more problems - instead of showing the titles and content excerpts from the actual Japanese articles that contain the Japanese word, it just shows the English - the only difference from if I search on the English word is that after the section and category it has the name of the language, indicating, I guess, that the real search result is the translated page - why won't it just show the real page instead? And just like the first example, the links are wrong - in this case they all point to the English pages (".../en/..." or "...lang=en").
Now I'll search for something that will appear in both languages, the time "10:15". In Japanese I see this:
which properly shows the results titles and excerpts in their real languages, but both titles still link to the Japanese version of the article.
Now I switch to English and it looks like this:
Doesn't that look strange to show the same page twice? And of course the links both point to the English, as well.
So there are two problems, with different kinds of behavior, and they may be unrelated, code-wise:
- When viewing a results page using the default language of the site, for search hits that are on translated pages, the titles, excerpts, etc. of still shown only in the default language version of the page (with just the language name in parentheses), rather than the real language of the search hit.
- In all cases, hyperlinks on search results point only to the page in the current viewing language, not the language that matches the actual result of the search.
Can anyone tell me whether these two behaviors are design decisions or bugs?
Joomla 1.5.15, Joomfish 2.0.4 with English and Japanese, YOOtheme template "WayBeyond"
Apache on Linux with PHP 5.1.6, MySQL 5.0.45, memory_limit 20MB