Moodle

Broken setup_lang_from_browser

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.8
  • Fix Version/s: 1.8, 1.9
  • Component/s: Language
  • Labels:
    None
  • Environment:
    WAMP
    Apache 2.2.4
    PHP 5.2.1
    MySQL 5.0.33
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_18_STABLE
  • Fixed Branches:
    MOODLE_18_STABLE, MOODLE_19_STABLE

Description

I have a fresh install of the latest Moodle 1.8 build, and the default language setting in the admin panel does not work. I have two language packs installed, en_utf8 and en_us_utf8. The default site language is English (en_us) and the main Moodle page lists English (en) as the language when you visit the page (while not logged-in). I log in as admin (admin's language in edit profile is set to English(en_us_utf8)) and the site language still stays at English(en).

Issue Links

Activity

Hide
Petr Škoda (skodak) added a comment -

It is, but now this setting has lower priority than preferred language selected in your web browser.

Show
Petr Škoda (skodak) added a comment - It is, but now this setting has lower priority than preferred language selected in your web browser.
Hide
Ryan Smith added a comment -

A question:

Do you mean that it will use the language that your web browser is set to?

I have tested this problem on Firefox 2.0.0.2 and Internet Explorer 7. Both browsers have English (en-us) set as the preferred language.

Show
Ryan Smith added a comment - A question: Do you mean that it will use the language that your web browser is set to? I have tested this problem on Firefox 2.0.0.2 and Internet Explorer 7. Both browsers have English (en-us) set as the preferred language.
Hide
Petr Škoda (skodak) added a comment -

hmm, the - _ difference might be the problem

Show
Petr Škoda (skodak) added a comment - hmm, the - _ difference might be the problem
Hide
Petr Škoda (skodak) added a comment -

fixed in cvs, thanks for the report!

Show
Petr Škoda (skodak) added a comment - fixed in cvs, thanks for the report!
Hide
Mauno Korpelainen added a comment -

Hi Petr,

this happens with all parent languages...

Works perfect otherwise.

Show
Mauno Korpelainen added a comment - Hi Petr, this happens with all parent languages... Works perfect otherwise.
Hide
Petr Škoda (skodak) added a comment -

not fixed yet - sorry

Show
Petr Škoda (skodak) added a comment - not fixed yet - sorry
Hide
Petr Škoda (skodak) added a comment -

problems fixed:
1/ failing if browser lang contains dash
2/ did not respect user language
3/ did not handle multiple selected langs in browser

reclosing now...

Show
Petr Škoda (skodak) added a comment - problems fixed: 1/ failing if browser lang contains dash 2/ did not respect user language 3/ did not handle multiple selected langs in browser reclosing now...
Hide
Jenny Gray added a comment -

Sorry, I think you might need to re-open this one. This isn't respecting the site default language. In my case, I have en_oc_utf8 as the site default and includes language strings specific to openlearn, which inherits from en_utf8.

The browser lang is en-us, so I'm getting that instead of en_oc_utf8 when not logged in. As soon as I'm logged in, even as the guest user, its fine because of the user language fix above.

Show
Jenny Gray added a comment - Sorry, I think you might need to re-open this one. This isn't respecting the site default language. In my case, I have en_oc_utf8 as the site default and includes language strings specific to openlearn, which inherits from en_utf8. The browser lang is en-us, so I'm getting that instead of en_oc_utf8 when not logged in. As soon as I'm logged in, even as the guest user, its fine because of the user language fix above.
Hide
Petr Škoda (skodak) added a comment -

This is not a bug IMHO, it works as expected - the browser setting takes over the default.

In this case you should define _local en language pack because you are not creating new language, you want to customize existing lang, right?

Please note that inventing new en_xx is not good for standards and accessibility.

Show
Petr Škoda (skodak) added a comment - This is not a bug IMHO, it works as expected - the browser setting takes over the default. In this case you should define _local en language pack because you are not creating new language, you want to customize existing lang, right? Please note that inventing new en_xx is not good for standards and accessibility.
Hide
Jenny Gray added a comment -

Hum, maybe this will have to be an OU specific change then. We already have an en_local pack which contains changes shared between our two different Moodle environments (our VLE for paying students and our open content site, OpenLearn).

We then additionally have en_oc and en_vl packs with changes that are specific to the two different sites. This is the easiest way we can maintain a single codebase.

I guess I'll have to add something that suits just us

Show
Jenny Gray added a comment - Hum, maybe this will have to be an OU specific change then. We already have an en_local pack which contains changes shared between our two different Moodle environments (our VLE for paying students and our open content site, OpenLearn). We then additionally have en_oc and en_vl packs with changes that are specific to the two different sites. This is the easiest way we can maintain a single codebase. I guess I'll have to add something that suits just us
Hide
Petr Škoda (skodak) added a comment -

Those are different installs, right? Why not merge those lang changes using some ext tool and prepare only one en_local for each site.
Anyway if you find some easy way to do it in a way that keeps the external name as "en" only, please let me know.

I think I will have to add a switch for disabling of this new feature - ppl might not like it on their sites.

Show
Petr Škoda (skodak) added a comment - Those are different installs, right? Why not merge those lang changes using some ext tool and prepare only one en_local for each site. Anyway if you find some easy way to do it in a way that keeps the external name as "en" only, please let me know. I think I will have to add a switch for disabling of this new feature - ppl might not like it on their sites.
Hide
Petr Škoda (skodak) added a comment -

I will tweak it to use the languages allowed in lang menu only (if defined in admin settings) - then you can exclude "en" from there.

Would it solve your problem?

Show
Petr Škoda (skodak) added a comment - I will tweak it to use the languages allowed in lang menu only (if defined in admin settings) - then you can exclude "en" from there. Would it solve your problem?
Hide
Jenny Gray added a comment -

I'm not sure - it depends on what it falls back to if it can't find the browser setting in the allowed languages list.

Show
Jenny Gray added a comment - I'm not sure - it depends on what it falls back to if it can't find the browser setting in the allowed languages list.

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: