Closed Bug 846432 Opened 11 years ago Closed 11 years ago

Language tag fallback behavior is inconsistent

Categories

(Core Graveyard :: DOM: Apps, defect)

x86
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: marcos, Unassigned)

References

Details

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0
Build ID: 20130215130331

Steps to reproduce:

I want the name of the application to be localized for a particular locale, but I don't want to duplicate the developer information. 

For example, given user agent locale "en-US": 
{
  "name": "您好!颜色",
  "locales": {
    "en-US": {
      "name": "Hi! Color"
    },
    "en-AU": {
      "name": "G'Day! Colour"
    },
    "en": {
      "developer": {
        "name": "en developer"
      }
    }
  },
  "developer": {
    "name": "中国开发者"
  },
  "default_locale": "zh-Hans"
}



Actual results:

FxOS selects the correct name, but then shows the developer name at the root of the manifest. 


Expected results:

I would have expected "en developer" as the developer's name.
To address the above, the user agent should arrange the user's preferred locales and decompose them in order (removing any duplicates). So, if the user has: 

"en-US, en-AU, jp" 

as her preferred language settings, those would decompose to:

"en-US, en-AU, en, jp". 

The decomposed language tags could then be used by the user agent in order to select correct localized content. If no match is made, then just use the content at the root of the manifest (as is currently done).
See Also: → 846269
Component: General → DOM: Apps
Technically what you would need to do in this case would be to put the developer info in the root of the JSON tree. That's the default. A locale override is for a specific locale to override that info if the device's locale matches. So this isn't a bug on our end - you need to fix your manifest.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → INVALID
Hi Jason, 

(In reply to Jason Smith [:jsmith] from comment #2)
> Technically what you would need to do in this case would be to put the
> developer info in the root of the JSON tree. That's the default. A locale
> override is for a specific locale to override that info if the device's
> locale matches. So this isn't a bug on our end - you need to fix your
> manifest.

Not sure if you missed it, but the developer info is at the root ("name": "中国开发者"), but I want to localize it into all the English variants. To do that, I would need to repeat it over and over again.
Summary: Language tag fallback behavior is inconstant → Language tag fallback behavior is inconsistent
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.