This project is archived and is in readonly mode.

#273 ✓wontfix

Mootools.lang cascade implementation incomplete

Reported by ju1ius | February 28th, 2010 @ 05:47 AM | in

The Mootools.lang cascade should take both language-code and country-code into account,
i.e. if my locale is set to fr-BE but there is no fr-BE dictionary, Mootools.lang should attempt to retrieve it from the fr dictionary, or another default dictionary with the same language code, like fr-FR, and only then use the other languages available.
This would allow easy communication between server-side code and mootools.

var data = {
  language: 'en-US',
  languages: {

'en': {
  'default': 'US',
  'US': {},
  'GB': {}

} }

Comments and changes to this ticket

  • fakedarren

    fakedarren February 28th, 2010 @ 11:34 PM

    • Assigned user set to “fakedarren”
    • State changed from “new” to “hold”
    • Milestone set to

    Very much doubt this will be fixed. It requires browser sniffing etc which is really not the job of JavaScript. This is your responsibility. But will discuss.

  • Fábio M. Costa

    Fábio M. Costa March 1st, 2010 @ 12:00 AM

    browser sniffing? No i think you got it incorrectly.

    I think the idea @ju1ius is giving is simple (correct me if im wrong).

    Hes just saying that if the current Moo.Lang doenst have the translation for 'pt-br', for example, it should fallback to the 'pt' translation before falling back to another defined translation ('en-us' for example).

  • fakedarren

    fakedarren March 1st, 2010 @ 12:04 AM

    I may very well have understood the ticket the wrong way. @ju1ius?

  • ju1ius

    ju1ius March 1st, 2010 @ 03:30 PM

    Yep, Fabio got it right ;)

  • ju1ius

    ju1ius March 1st, 2010 @ 03:40 PM

    This is the standard behavior adopted by the Accept-Language Http header:

    Accept-Language: fr-fr,fr;q=0.8,en-us;q=0.5,en;q=0.3
    If there's no fr-fr, fallback to fr, then to en-us and finally to en
  • Aaron Newton

    Aaron Newton October 12th, 2010 @ 04:10 AM

    • State changed from “hold” to “wontfix”
    • Milestone changed from to
    • Milestone order changed from “0” to “0”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

The MooTools Extensions

People watching this ticket