Hello.
I try to know is it a feature or a bug. If it is a feature, then I have to tell you, this is a very bad feature, because then we have a chance that if there sre no other links to the translated pages, then it wolud never be added to toe search bot indexes.
The questions are -
1) how can I enable an option "Switch by url's language prefix" for it working with cookies off? An explanation of a situation is below.
2) how can I enable an option "Detect through browser's language" for it working ONLY when the user enters a site WITHOUT a language prefix, and when the URI he asked contains the language prefix - then the Localizer module doesn't take in mind what language is provided by browser?
I mean: http://domain.com/ - Localizer redirects to the page with the language provided, but http://domain.com/en/main or http://domain.com/ru/main - Localizer DOES NOT redirect the user anywhere and DOES NOT take in mind what language is provided by browser (because theere is already a language code in URI.
Now let me explain from the beginning abuot th question #1. I create a site. I install a Localizer module as described in help. I add new language so I now have two languages - English and Russian. I add two pages: domain.com/ru/main and domain.com/ru/example. I set the domain.com/ru/main page as title page. I translate these pages to: domain.com/en/main and domain/com/en/example. I set the Localizer option "Switch by url's language prefix" on.
Then I disable cookies and js and login as anonymous. The Localizer module automatically redirects me to the browser's default language provided (en or ru) - it's ok. When I click the menu link which locates me to my "example" page - it's all ok too.
BUT. When I now (being on "example", not main page) click to the link in Localizer block to switch language to other (no means which of them) - my browser falls into the recurse redirecting page to itself (100% CPU usage for 5-10 seconds, then Opera tells me that it had been redirected to the page with the same URL I just visited (so if I was at RU - it tells me it had to go to RU again and if I was at EN - it tells me it had to go to EN again). You may see the attachment.
Is it correct? If so, then the result of this behavioe is that if there are no external links to the translated page - it would never be added to the search engines indexes, because, as we all know, even Google doesnt support cookies.
| Comment | File | Size | Author |
|---|---|---|---|
| localizer.jpg | 28.88 KB | Julia Trushina |
Comments
Comment #1
Roberto Gerola commentedHi.
Cookies dependency has been removed in the latest development version, please, use that instead.
First page redirect, could not work correctly with search engines, because Localizer uses the Drupal
sessions to store the current language (in fact it uses the standard Drupal mechanism to remember
the language selected by the user).
Except the first page redirect, the other features should work correctly also with SE with the latest development
version.
Please, try it and send me your feedback.
Thanks
Roberto
Comment #2
Julia Trushina commentedThank you for your answer.
Well, if under "latest development" you mean this release - http://ftp.drupal.org/files/projects/localizer-5.x-1.x-dev.tar.gz - then I have the different bahavour, but the same result.
I have just created a new site with the same structure, added some fake content (see the first message - nothing changes) but used the DEV version of localizer (I mean that I did not use the old site with deleting old module, I have just created a new one).
Now I have the situation:
If the checkbox "Redirect front page to the localized version" is UNchecked, I have the recurse redirect of the page to itself, as it described in my first message. If this checkbox is checked, then I have the situation: when I click to the localized hyperlink, the localizer module always redirects me to the page with the language provided by browser, no matter of the language of the content of the hyperlink target. (Example: I click on "ru/main" or "ru/example" link, but Localizer always [no matter of main page/not main page] redirects me to "en/main" or "en/example" - because the EN language is default for my browser and so on).
This situation repeats ONLY when cookies are disabled. When enabled, everything is just fune.
I think it is easy to make a model of this situation - new test site, new locale, install module, add 2 pages, add a fake content, one of them is the main page, translate both of them. That's all I have done to get the result described.
Thank you for your support,
Julia.
Comment #3
Roberto Gerola commented> Well, if under "latest development" you mean this release
Yes, that is.
> If this checkbox is checked, then I have the situation: when I click to the localized hyperlink, the localizer module always redirects me to the
> page with the language provided by browser, no matter of the language of the content of the hyperlink target. (Example: I click on "ru/main"
> or "ru/example" link, but Localizer always [no matter of main page/not main page]
> redirects me to "en/main" or "en/example" - because the EN language is default for my browser and so on).
It seems to be a conflict with another setting.
Could you send me the list of your Localizer settings (a screenshot is ok) ?
Thanks.
In every case, if you disable cookies, also Drupal internal translation will stop
to work, not only Localizer, because it relies on a session variable to remember
the selected language.
Roberto
Comment #4
Roberto Gerola commentedJulia was right.
There was a bug.
It has been fixed. Now the language change routine is a little more quick because it
avoids useless double calls.
Thanks
Roberto
Comment #5
(not verified) commented