w3c / manifest

Manifest for web apps
https://www.w3.org/TR/appmanifest/
Other
648 stars 154 forks source link

Use of `CanonicalizeUnicodeLocaleId` #1084

Open aphillips opened 1 year ago

aphillips commented 1 year ago

lang member https://w3c.github.io/manifest/#lang-member

Set manifest["lang"] to the result of calling the CanonicalizeUnicodeLocaleId abstract operation with json["lang"].

The instructions on processing the lang member are inconsistent with the description of what a lang member can contain. The ECMA-402 function CanonicalizeUnicodeLocaleID is invoked and this results in a variety of potential changes to a few otherwise-valid values. This is probably the right thing to do when actually consuming the lang member's value (particularly with Intl.Locale and friends in JavaScript), but its sudden appearance buried in the processing instructions makes this surprising. This suggests that lang should actually be defined as a Unicode Locale ID??

It's not clear if referencing Unicode Locale IDs is the right thing for the manifest spec to do, since the manifest is mainly concerned with transmitting data values, not actually performing runtime processing.

marcoscaceres commented 10 months ago

I guess we just want to make sure we always get a canonical language tag.