-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Greater BCP47 compatibility? #21
Comments
Granted, this would represent a pretty significant rewrite of the package. If there is no appetite for that, I may write one that provides full BCP47 coverage. |
Sorry for the delayed reply! For some reason I wasn't notified of this Issue. 🤔 @eborden, do you have any thoughts here? |
@despresc I certainly see no problem with continuing to expand coverage of this library. Some decisions such as leveraging |
Thanks for the reply! Actually, between opening this issue and your reply, I started work on my own package. I'm not sure how well it can be ported over, since it happens to represent BCP47 tags and subtags differently than how they are in this package, and the parsing and analysis flow is also a bit different. I think I may just continue working on it, since it's fairly well developed at this point. Sorry for the duplicated effort. |
@despresc if you have time, can you verify that I've characterized these issues correctly in this comment? See also these pending tests. |
Yes, the The |
Are there plans for greater BCP47 compatibility? The tags
es-419
,en-gb
,en-TP
, andcmn
, for instance, are not recognized by the library. That last tag is even the preferred encoding of Mandarin Chinese (over the currently-recognizedzh-guoyu
, and others) according to the IANA registry.The
Region
component in particular seems odd, since it will fail to recognize any of the three digit region codes (like 419) registered with the IANA, but it will recognize tags with three digit country codes that already have two letter codes, like inzh-012
. (Such codes must not be used in tags, according to https://tools.ietf.org/html/rfc5646#section-2.2.4, item 4.D).There is also a small issue that may be a problem in the future, though it is probably unlikely: the primary language tag is not defined to include all of ISO 639-1. The IANA will not register any future ISO 639-1 code that is already covered by a three letter code (see https://tools.ietf.org/html/rfc5646#page-11), so this library would have to switch away from the
iso639
package in that event (assuming that package is updated to include the code) to remain correct.The text was updated successfully, but these errors were encountered: