Feature #2691

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

Added by Mischa The Evil about 9 years ago. Updated about 4 years ago.

Status:ClosedStart date:2009-02-07
Priority:NormalDue date:
Assignee:Jean-Philippe Lang% Done:

0%

Category:UI
Target version:2.5.0
Resolution:Fixed

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 Magnifier - Patch created against trunk@r2383. (3.38 KB) Mischa The Evil, 2009-02-07 00:28

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

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


Related issues

Duplicated by Redmine - Defect #4311: Settings default language not (really) used Closed 2009-11-30
Duplicated by Redmine - Feature #12112: Forcing locale (language) on a project Closed

Associated revisions

Revision 12691
Added by Jean-Philippe Lang about 4 years ago

Adds settings for disabling browser language detection and language preference (#2691).

Revision 12692
Added by Jean-Philippe Lang about 4 years ago

Adds locales strings (#2691).

History

#1 Updated by Jean-Philippe Lang about 9 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 9 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 9 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 9 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 8 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 7 years 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.

#7 Updated by Ebrahim Mohammadi about 4 years ago

I miss this option severly. No recent development? Not available as a plugin?

#8 Updated by Jean-Philippe Lang about 4 years ago

  • Tracker changed from Patch to Feature
  • Category changed from Administration to UI
  • Status changed from New to Closed
  • Assignee set to Jean-Philippe Lang
  • Target version set to 2.5.0
  • Resolution set to Fixed

r12692 adds 2 new settings that let force the default language for anonymous and/or logged-in users.

#9 Updated by Go MAEDA about 2 years ago

  • Duplicated by Feature #12112: Forcing locale (language) on a project added

Also available in: Atom PDF