-
Improvement
-
Resolution: Fixed
-
Minor
-
3.8, 3.10
-
MOODLE_310_STABLE, MOODLE_38_STABLE
-
MOODLE_310_STABLE
-
MDL-67419-master -
Prerequisites:
- Use a Moodle instance where user accounts are created automatically upon first login, e.g. from LDAP.
- Prepare 3 user accounts which will be created on the fly upon first login
- Login as admin
- Install the german language pack besides the english language pack
- Set $CFG-> autolang = true
- Set $CFG-> lang = German
- Logout
Scenario 1
- Set your preferred browser language to german
- Clear your browser caches and cookies
- Go to the Moodle login page
- Verify that you see Moodle in german as this language was autodetected for you
- Login with user 1
Expected result:
- User 1 will have the german language set in his user profile as this was his preferred browser language when his account was created.
Actual result:
- User 1 will have the german language set in his user profile as this is the site's standard language and is used for auto-created new accounts
Scenario 2
- Set your preferred browser language to english
- Clear your browser caches and cookies
- Go to the Moodle login page
- Verify that you see Moodle in english as this language was autodetected for you
- Login with user 2
Expected result:
- User 2 will have the english language set in his user profile as this was his preferred browser language when his account was created.
Actual result:
- User 2 will have the german language set in his user profile as this is the site's standard language and is used for auto-created new accounts*
Scenario 3
- Set your preferred browser language to french
- Clear your browser caches and cookies
- Go to the Moodle login page
- Verify that you see Moodle in german as there isn't a language pack installed for the autodetected french language and as german, the site's standard language, is used as fallback.
- Login with user 3
Expected result:
- User 3 will have the german language set in his user profile as there isn't a language pack installed for his preferred browser language and as german, the site's standard language, is used as fallback.
Actual result:
- User 3 will have the german language set in his user profile as this is the site's standard language and is used for auto-created new accounts
Proposal
The described actual results of the described scenarios might be fine for some Moodle installation, but there are also installations which expect the expected results. Thus, an admin setting is needed.
We propose to add a new admin setting to /admin/settings.php?section=langsettings called "Choose user account language during account auto-creation" with these values:
- Set user account language to browser language (Default for new sites which produces the expected behavior described above)
- Set user account language to default site language (Default for upgraded sites as it's the current actual behavior)
Alternatively, $CFG->autolang could be extended to cover the additional needs. It would have to be changed from a checkbox to a dropdown setting.
- Testing discovered
-
MDL-69626 When current browser language is not installed, default language is not used
- Closed