Patch #2691

Option to disable automated language-guessing based on HTTP_ACCEPT_LANGUAGE HTTP-header

Added by Mischa The Evil over 3 years ago. Updated over 1 year ago.

Status:New Start date:2009-02-07
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Administration
Target version:-

Description

This is a patch to make it possible to disable Redmine's default behaviour of using automated language-guessing based on the HTTP_ACCEPT_LANGUAGE HTTP-header.

This is again a patch based on the implementation of this feature by the Typo3-Forge team. You can find it here. I only made it a configurable setting through Redmine -> Administration -> Settings > Display. The default value is to use automated language-guessing based on the HTTP_ACCEPT_LANGUAGE HTTP-header, thus default behaviour isn't changed by default.

option_to_disable_language_guessing-r2383.patch - Patch created against trunk@r2383. (3.4 kB) Magnifier Mischa The Evil, 2009-02-07 00:28

0001-Redmine-default-locale-used-before-browser-locale-en.patch - First part (2.2 kB) Magnifier Thomas Lecavelier, 2009-12-18 12:22

0002-Add-option-to-force-default-language-for-non-logged-.patch - Last part (with the option and remove the blank default language) (23.5 kB) Magnifier Thomas Lecavelier, 2009-12-18 12:22


Related issues

duplicated by Defect #4311: Settings default language not (really) used Closed 2009-11-30

History

#1 Updated by Jean-Philippe Lang over 3 years ago

Actually, it seems to do more than disabling the detection of the browser's language.

It also ignores the language that the user have chosen on its account. If it's the desired behaviour, we should either hide the 'Language' preference field on 'My account' or have a separate setting to allow/disallow registered users to choose a different language.

#2 Updated by Mischa The Evil about 3 years ago

Jean-Philippe Lang wrote:

Actually, it seems to do more than disabling the detection of the browser's language.

Indeed, you are correct... :)

It also ignores the language that the user have chosen on its account. If it's the desired behaviour, we should either hide the 'Language' preference field on 'My account' or have a separate setting to allow/disallow registered users to choose a different language.

My initial intention was to completely disable the buildin internationalisation to be able to configure a language as being 100% static...

In that light I'd say we go for the separate setting to allow/disallow registered users to choose a different language with the extension that if the setting is disallowed no automated language-guessing, based on HTTP_ACCEPT_LANGUAGE HTTP-header, is applied.
This seems to me the most logical solution instead of having two dedicated settings like:
  1. allow/disallow registered users to choose a different language
  2. enable/disable automated language-guessing based on HTTP_ACCEPT_LANGUAGE HTTP-header

What do you think?

#3 Updated by Harri H almost 3 years ago

Mischa The Evil wrote:

In that light I'd say we go for the separate setting to allow/disallow registered users to choose a different language with the extension that if the setting is disallowed no automated language-guessing, based on HTTP_ACCEPT_LANGUAGE HTTP-header, is applied.
This seems to me the most logical solution instead of having two dedicated settings like:
  1. allow/disallow registered users to choose a different language
  2. enable/disable automated language-guessing based on HTTP_ACCEPT_LANGUAGE HTTP-header

What do you think?

Well, I'm not Jean-Philippe but could throw out some ideas related to this. It seems to me that your patch isn't in the trunk yet so I assume this issue is still open.

The reason I started looking at this language issue more closely is that when arriving to Redmine home for the first time (as a non-registered user), UI was in Finnish for me. Uh. Somebody might like it, but I don't. And there was no way to change the language (without registering and logging in). Not very nice, if I may say. If there's something like UI language selection happening automatically user should be able to change it when necessary - let's try not to mimic behaviour of our friend Windows and try to be "smart" and "know" what the user wants without providing means to influence the decision (easily).

Anyway, I would suggest that also a non-registered user could be able to change the UI language. For example, a dropdown box with 'Set' button to upper right corner and the selected language could be saved to cookies/session. And, of course, if the current user decides to register, this selected language could be selected automatically in the language selection dropdown, meaning the user doesn't have to touch the language setting (ever) again. The automatic language sniffing could be as it is now, users could just change the language on the rare case they don't like the one system chose.

Does this make any sense, any thoughts?

And yes, I'm new to this project, so if there has been discussion on this topic elsewhere, please forgive me.

#4 Updated by Mischa The Evil almost 3 years ago

Harri H wrote:

The reason I started looking at this language issue more closely is that when arriving to Redmine home for the first time (as a non-registered user), UI was in Finnish for me. Uh. Somebody might like it, but I don't. And there was no way to change the language (without registering and logging in). Not very nice, if I may say.

Good point you mention there which IMHO should definately has to be taken into consideration within this issues scope.

Regards,

Mischa.

#5 Updated by Thomas Lecavelier over 2 years ago

Here an escape from #4311.

I repost my first patch, adapted to current trunk, with a second one giving an option to force usage of the Setting.default_language over the HTTP_ACCEPT_LANGUAGE.

Hoping this help.

#6 Updated by Mischa The Evil over 1 year ago

Thomas Lecavelier wrote:

Here an escape from #4311.

I repost my first patch, adapted to current trunk, with a second one giving an option to force usage of the Setting.default_language over the HTTP_ACCEPT_LANGUAGE.

Hoping this help.

Thomas,

This "escape" will do it for me. Thanks for sharing. Hope they'll make it into the core.

Mischa.

Also available in: Atom PDF