Issue Details (XML | Word | Printable)

Key: MDL-11243
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Martin Dougiamas
Reporter: Iñaki Arenaza
Votes: 3
Watchers: 1
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Admin settable default language for front page

Created: 13/Sep/07 08:24 PM   Updated: 16/Dec/07 12:10 AM
Return to search
Component/s: Languages
Affects Version/s: 1.8.2, 1.9
Fix Version/s: 1.9, 2.0

File Attachments: 1. File default_language_preferences_18.diff (4 kB)
2. File default_language_preferences_19dev.diff (4 kB)

Issue Links:
Duplicate
 
Relates
 

Participants: Daniel McHugh, Iñaki Arenaza, Koen Roggemans and Martin Dougiamas
Security Level: None
Resolved date: 16/Dec/07
Affected Branches: MOODLE_18_STABLE, MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE, MOODLE_20_STABLE


 Description  « Hide
From Moodle 1.8 on, the default front page language setting is overrided by the browser language configuration. There isn't even mention of this in the help for the page, the release notes or the documentation.

As proposed in MDL-8791 (http://tracker.moodle.org/browse/MDL-8791#action_27506), I've implemented an option in the language settings page to specify if we prefer the browser settings or the admin configured settings.

The attached patches implement it for 1.8 and 19dev, current as of today.

Saludos. Iñaki.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Koen Roggemans added a comment - 30/Sep/07 04:08 PM
Thanks for reporting this.
I reassign it to moodle.com.
I've read about this behaviour somewhere, but can't remember where, which is not very useful.

Daniel McHugh added a comment - 06/Dec/07 04:07 AM

Koen Roggemans comment stating that this is not a very useful feature is wrong. I'd say its a not very useful implementation. Having the site come up with the default language based on a persons browser is a very good thing, having it so that you cant control it is a bad thing.

I'm an English administrator for an all French site. I need the Administration pages to be in English so I can administrate the site with out learning the language. The site itself is not supposed to have a drip of English in it as it's a french school in Canada. So I need to override this behavior of browser language. Otherwise I'd love the feature of using the Browser language!

Now I know how to operate diffs and patches but it's not something that every one knows how to do or has the ability to do. For those of you that have to manually apply the above file... Locate the section of code in the files shown inside the text and add (Inserts) the code followed by + signs. Don't forget to remove the leading plus signs! I'd copy paste and remove the plus signs. This will make sure you don't get any typos.

For example in the 1.8 file given above find the section at the end that reads:

index bac5fed..427c0b7 100644
— a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -6957,6 +6957,11 @@ function setup_lang_from_browser() { return; }

+ if (empty($CFG->langbrowser)) { + // We prefer configured site default language over browser language. + return; + }
+
if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { // There isn't list of browser langs, nothing to do return; }

This section of the file is saying in the file lib/moodlelib.php add the lines (note the exclusion of the + signs):

if (empty($CFG->langbrowser)) { // We prefer configured site default language over browser language. return; }

Where I have typed --->>>>>>>>>>>>>>> Insert here <<<<<<<<<<------ :

return;
}

--->>>>>>>>>>>>>>> Insert here <<<<<<<<<<------

if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { // There isn't list of browser langs, nothing to do return; } }

Now I mention this exact section in the code as it is really the only confusing addition to be made out of the changes required.

P.S
I now have this patch running and working in Version 1.8.3 by manually editing the file (not to be done without keeping a backup copy of the original files!!!!)


Iñaki Arenaza added a comment - 16/Dec/07 12:10 AM
This issue has been fixed in MDL-12570 (which duplicates this bug).

So closing now. Thanks to everybody!

Saludos. Iñaki.