mattcg / language-tags

A Swiss Army knife for language tags.
63 stars 13 forks source link

Some of the official examples are considered invalid #6

Open LinusU opened 7 years ago

LinusU commented 7 years ago

It seems like the following language tags, picked right from Appendix A of bcp47, isn't considered valid. Is this a bug?

[
  'i-enochian',
  'sl-rozaj-biske',
  'x-whatever',
  'qaa-Qaaa-QM-x-southern',
  'de-Qaaa',
  'sr-Latn-QM',
  'sr-Qaaa-RS'
]
mattcg commented 7 years ago

Hi Linus, thanks for reporting this.

The tag 'i-enouchian' is deprecated, so:

tags('i-enochian').errors()[0].message;

Will give you: 'The tag \'i-enochian\' is deprecated.'

There's a spec question here: should a deprecated grandfathered tag be considered valid or invalid?

For all the others, those tags are valid according to the spec, so I guess we need to make some fixes to the parser.