Coder Social home page Coder Social logo

Spec questions/errors about proposal-intl-locale HOT 13 CLOSED

tc39 avatar tc39 commented on June 17, 2024 1
Spec questions/errors

from proposal-intl-locale.

Comments (13)

zbraniecki avatar zbraniecki commented on June 17, 2024 1

Is there an option for us to not support grandfathered tags at all?

from proposal-intl-locale.

zbraniecki avatar zbraniecki commented on June 17, 2024

Do we want to restrict the input for Intl.Locale if certain Unicode extensions values aren't supported in Intl.{Collator, NumberFormat, DateTimeFormat}?

I don't think we want that. Intl.Locale is supposed to handle any bcp47 language tag string, not just the one we support in other formatters.

from proposal-intl-locale.

anba avatar anba commented on June 17, 2024

#13 should fix all mentioned issues except for:

Step 3 should read:
If tag matches the langtag production and does not match grandfathered,
to cover the case of regular grandfathered language tags.

from proposal-intl-locale.

littledan avatar littledan commented on June 17, 2024

@anba My intention was to simply not support grandfathered language tags.

from proposal-intl-locale.

anba avatar anba commented on June 17, 2024

Only irregular or also regular grandfathered language tags?

from proposal-intl-locale.

littledan avatar littledan commented on June 17, 2024

Oh sorry, I meant irregular grandfathered tags. So, the change you are suggesting seems important.

from proposal-intl-locale.

anba avatar anba commented on June 17, 2024

Oh sorry, I meant irregular grandfathered tags. So, the change you are suggesting seems important.

Hmm, I'm a bit confused right now. The suggested change is only important if we also disallow regular grandfathered language tags.

from proposal-intl-locale.

anba avatar anba commented on June 17, 2024

On second the possible restriction should probably use If tag matches neither the privateuse nor the grandfathered production, followed by Assert: tag matches the langtag production. instead of If tag matches the langtag production and does not match grandfathered,, because the former more clearly states the two unsupported productions.

from proposal-intl-locale.

littledan avatar littledan commented on June 17, 2024

I've tried to represent these questions on the agenda of the Intl call next Friday so we can get more input.

from proposal-intl-locale.

anba avatar anba commented on June 17, 2024

There are at least two more issue with grandfathered tags:

1. If the input is a regular grandfathered tag without a modern replacement, appending Unicode extension sequences will create a non-valid language tag ("valid" in the sense of https://tools.ietf.org/html/rfc5646#section-2.2.9):

var loc = new Intl.Locale("cel-gaulish", {nu: "latn"});
print(loc.toString()); "cel-gaulish-u-nu-latn"

Since cel-gaulish-u-nu-latn no longer matches a grandfathered production, it has to be interpreted as a langtag language tag, which in turn means gaulish has to interpreted as a variant subtag. But gaulish is not a registered variant subtag, so the generated tag cel-gaulish-u-nu-latn is non-valid per RFC 5646.

While Intl.Locale in general doesn't care about non-valid language tags, we may still want to prevent generating non-valid language tags if the input itself was a valid language tag.


2. ICU uses its own replacement for grandfathered tags without modern replacements (and en-GB-oed).

  • cel-gaulish → xtg-x-cel-gaulish
  • zh-min → nan-x-zh-min
  • en-GB-oed → en-GB-x-oed (Modern replacement available: en-GB-oxendict)
  • i-default → en-x-i-default
  • i-enochian → x-i-enochian
  • i-mingo → see-x-i-mingo

As with the other grandfathered tags issues this shouldn't matter much in practice, because I don't expect that grandfathered tags are actually used in normal code.

from proposal-intl-locale.

srl295 avatar srl295 commented on June 17, 2024

@anba

en-GB-oed → en-GB-x-oed (Modern replacement available: en-GB-oxendict)

Good catch. filed IcuBug:13650

from proposal-intl-locale.

littledan avatar littledan commented on June 17, 2024

We discussed grandfathered tags at the last Intl meeting. The resolution, I believe, was to support regular and irregular grandfathered tags by mapping them each to modern tags, at the beginning of the process of parsing them. I believe this change was recommended for all of Intl, and not just Locale.

from proposal-intl-locale.

littledan avatar littledan commented on June 17, 2024

We've switched to Unicode BCP 47 Locale Identifiers, fixing the remaining issues.

from proposal-intl-locale.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.