GithubHelp home page GithubHelp logo

r12a / app-subtags Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 4.0 2.13 MB

BCP 47 language tags are built from subtags in the IANA Subtag Registry. This tool helps you find or look up subtags and check for errors in language tags.

PHP 1.00% JavaScript 96.61% HTML 1.75% CSS 0.65%

app-subtags's People

Contributors

r12a avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

app-subtags's Issues

Filter by date

I would like to be able to see all entries which have changed since a given date. I'm not sure if it's possible to identify all changes using only the registry, but it should be possible to show those which were added or deprecated.

Parsing of extensions: too generous?

Hi, I've been using the app-subtags web page to develop my understanding of BCP 47, and it has been very helpful; thank you.

Today I've been looking at extension subtags, and it seems that either (a) I've misunderstood BCP 47, or (b) app-subtags is "too generous" in accepting some uses of extensions.

The removeExtensions() function seems to assume that there is at most one extension, and this leads to some problems with the parsing.

So app-subtags accepts the following tag as well-formed, when, I think, based on RFC 5646, section 2.2.6, it should reject it:

  • tlh-t-u-foo : "Each singleton MUST be followed by at least one extension subtag" (RFC 5646, section 2.2.6, point 6). This tag is not "well-formed" according to the definition of well-formedness in section 2.2.9, since the tag does not conform to the ABNF in section 2.1. app-subtags incorrectly parses this as "the extension t-u-foo".

The following are well-formed, since they conform to the ABNF, but there is an opportunity for app-subtags to be "more helpful" in pointing out errors:

  • en-t-aaa-a-bbb : "The singleton MUST be one allocated to a registration authority via the mechanism described in Section 3.7 ..." (RFC 5646, section 2.2.6, point 2). The app-subtags code does already check that the singleton t is valid, but then doesn't "notice" that a- is the beginning of another extension, and check the singleton a.
  • en-t-bbb-t-ccc : "Each singleton subtag MUST appear at most one time in each tag (other than as a private use subtag)" (RFC 5646, section 2.2.6, point 3). Ditto, and as you parse, you have to keep track of which singletons you've seen, and make sure there aren't duplicates.

Case in subtags

Hello

I noticed that on https://r12a.github.io/app-subtags/ sub-tags such as Latn and geographical regions such as FR are in lower case (in the brown/grey bars).

I don't really know the importance of case in IETF codes, but if is is, it might be a good thing to use the appropriate case.

Best regards, Olivier.

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.