When setting language to 'nl' then back to 'en' the language is not automaticly changed.

Step to reproduce:
1. goto http://ex.com/
2. make sure english is choosen with the language switcher
3. goto http://ex.com/user/1/edit
4. change language to 'nl'
5. save
6. language is not changed to Dutch
7. Expected result would be http://ex.com/nl/user/1/edit (actually http://ex.com/nl/user/1)
8. (use language switcher to 'Dutch')
9. goto http://ex.com/nl/user/1/edit
10. change language to 'English)
11. save.
12. Expected result would be http://ex.com/user/1/edit

I think a redirect to the preferred language would be nice.

Regards,
Clemens

Comments

Gábor Hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

How Drupal behaves depends on the language negotiation settings. What is your language negotiation setting?

clemens.tolboom’s picture

My language negotiating setting is ' Path prefix only.'

But now D6 is out ... so i drop the site D6RC4 and start over ... looks the same to me in D6.

But now i noted language preferences are only for receiving emails!

So this is maybe a usage err!

BUT ... in D5 i always change user/1 to english and got the english UI. Is that now gone?

clemens.tolboom’s picture

Status: Postponed (maintainer needs more info) » Active

I still cannot get my user/1 language into english. My drupal 5 sites can have user/1 in english (so the admin is too) and default into dutch/nl

So do i have to file a bug?

clemens.tolboom’s picture

Version: 6.0-rc4 » 6.0
htalvitie’s picture

I have similar problems.

I am now running both a Drupal 5.7 and a Drupal 6.0 site. Both have been configured with two languages (Finnish as the second) and both have "Finnish" as the default language. I am not using the new "language negotiation" settings on the D6 site.

The obvious difference is, that on the D6.0 site, the default language is the only language functioning globally on the site. User-specific language preference (My Accounts page -> Language Settings) doesn't make any difference whatsoever. The moment I change the default language from English to Finnish, Finnish is all there is and vice-versa. This applies even for the admin user.

On the Drupal 5.7 site, the user's language preference is honored.

This is a definitive critical bug, imho.

Additionally, the labeling on the "My Account" setting page indicates something is wrong:

  • In Drupal 5.7, there is a user setting box called "Interface language settings" with a single field, "Language:" and the description "Selecting a different locale will change the interface language of the site".
  • In Drupal 6.0, there is a user setting box called "Language settings" with a single field, "Language:" and the description "This account's default language for e-mails."

If this is not a bug, then what has happened to the user-interface language support in Drupal?

Or is there a way to restore/activate the user-specific UI-selection language functionality in 6.0 like 5.7 has, have I missed a setting somewhere a misunderstood the new language logic completely?

htalvitie’s picture

Category: feature » bug
Priority: Normal » Critical

Ok, answering my own question (regarding the "is there a way to restore the old way"): Yes, there is - by changing the "Language negotiation" from None to Path prefix with language fallback.

I still believe this is a bug, since reading the description of the "None [language negotiation]" gives the impression that this setting allows user-specific UI languages:

"None The default language is used for site presentation, though users may (optionally) select a preferred language on the My Account page. (User language preferences will be used for site e-mails, if available.)"

I do not currently want to use the option "Path prefix etc.", since it involves dynamic inspection and wasted CPU cycles if I just want to have a simple, manually determined setting per user.

keith.smith’s picture

Status: Active » Postponed (maintainer needs more info)

Sure. If the description is confusing, we should change it. Can you explain further, though, which part you think is confusing?

The default language is used for site presentation, as you note clearly in #5. Users can optionally select a preferred language on their My Account page; if they do so in this mode, that preference is currently [only] used for e-mails sent by the site (as noted in the parenthetical).

htalvitie’s picture

The negotiation setting didn't fix per-user language configuration. I thought I did, because It worked on my ultra-simple Drupal 6 install right after install.

Maybe I have a caching issue on the production site which forces the translated strings to stick?

(I studied locale.module, and was wondering the logic of static string caching, noticed an option for disabling it by making the locale_cache_strings variable change directly - maybe I should try that, then?)

htalvitie’s picture

@keith.smith: "The default language is used for site presentation [..] Users can optionally select a preferred language on their My Account page"

Ok, trying to explain the confusing parts here. The description for "Language Negotiation: None" starts with: "The default language is used for site presentation" and then it continues with "though" [= in spite of the possibility, even if] "users may (optionally) select a preferred language on the My Account page."

So, this part sound to me as "my end-users are presented initially with the language I as the administrator have chosen, but if they dislike my choice, they can select a different language between all installed languages on my system."

@keith: "if they do so in this mode, that preference is currently [only] used for e-mails sent by the site (as noted in the parenthetical)."

I don't see how the phrasing would implicate that site presentation would cover only e-mails, nor that the "user has an option of selecting" means that the selection is actually getting neutralized by the site admin's preference.

htalvitie’s picture

"The negotiation setting didn't fix per-user language configuration" .. instantly, that is. After writing #9, I went back to my site, and noticed that - surprise! - language toggling works.

Still a mystery, why it didn't work initially. It could been cache related.. ?

(Hint/suggestion: I think we need a command "Clear all caches - now, please!". The current cache clearer seems to leave all kinds of residue behind. I don't feel safe emptying the cache tables manually.)

keith.smith’s picture

Status: Postponed (maintainer needs more info) » Active

@htalvitie: Ok. If something is confusing, it's confusing. If you didn't immediately understand it, there are likely others who also do not.

Is this more clear?

None. The default language is used for site presentation. Users may (optionally) select a preferred language for site e-mails on the My Account page.

I also note -- and this is my fault for not reading closer -- that the clarity of the embedded help is a problem different from that of the original poster, and is not reflected in the title of this issue. Please create a new issue for the help text and let us continue there, to avoid taking this issue off track.

(Also, note that there is a "Clear cache" button at /admin/settings/performance.)

@clemens.tolboom and Gabor: My apologies for derailing your issue.

htalvitie’s picture

@keith: Yes, that version is more clear. Thanks.

Should I create a new issue (support or otherwise?) to solve this question of having similar language preference functionality for Drupal 6 as is on 5.x, or is this issue thread suitable?

And also thanks for pointing out the clear cache button at /admin/settings/performance. I am aware of it and using it already, and was previously pointing out that it doesn't clear nearly all cached (especially language-related) values from the database. But you are right, it's a different issue.

htalvitie’s picture

@keith: "Please create a new issue for the help text and let us continue there, to avoid taking this issue off track."

Ok, a separate issue now exists for the help text confusion (#222401: Code block never executes in language_initialize()).

clemens.tolboom’s picture

Category: bug » support
Priority: Critical » Normal

I haven't reported this as a bug or critical ... :-/

htalvitie’s picture

@clemens: You're right, sorry for messing up the settings. I forgot to restore the original priority after creating a separate issue, #222401: Code block never executes in language_initialize().

(I'm still slightly noob with this issue system. But learning, hopefully.)

Gábor Hojtsy’s picture

OK, looks like after the detour, we are back to #2. User settings are only honored, when the URL otherwise does not tell Drupal what to select, and this is in the path prefix with fallback mode. Otherwise Drupal does not adhere to user settings, and the help texts try to explain this for the user and for the admin as well.

clemens.tolboom’s picture

Status: Active » Closed (fixed)

Thanks for #16 ... that made it finally clear to me.

I installed french and dutch.

admin/settings/language/configure: 'Path prefix only'

Went to http://ex.com/fr and got french. same goes for http://ex.com/nl
At fr/user/1/edit changed to english and got it.
So language switching is working.

I'm not sure why it didn't do this at first.

Case closed.

thePanz’s picture

Version: 6.0 » 6.6
Status: Closed (fixed) » Postponed (maintainer needs more info)

Hi, I'm re-opening this issue only to ask if is possible to implement (in that case I'll post a new feature-request) or, if there is any hook that can be triggered to switch the language, define another way to negotiate ONLY site-language interface. I'm using a single-locale UI site (Italian) and I'd like to present to users the Drupal UI regarding user-preference or Browser settings.

Regards

andypost’s picture

Version: 6.6 » 6.x-dev
Status: Postponed (maintainer needs more info) » Closed (duplicate)