Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ expressed as JSON Schema definitions.
| IETF | [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986) | Uniform Resource Identifier (URI): Generic Syntax |
| IETF | [RFC 4918](https://www.rfc-editor.org/rfc/rfc4918) | HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV) |
| IETF | [RFC 5322](https://www.rfc-editor.org/rfc/rfc5322) | Internet Message Format |
| IETF | [RFC 5646](https://www.rfc-editor.org/rfc/rfc5646) | Tags for Identifying Languages (BCP 47) |
| IETF | [RFC 5789](https://www.rfc-editor.org/rfc/rfc5789) | PATCH Method for HTTP |
| IETF | [RFC 6901](https://www.rfc-editor.org/rfc/rfc6901) | JavaScript Object Notation (JSON) Pointer |
| IETF | [RFC 7807](https://www.rfc-editor.org/rfc/rfc7807) | Problem Details for HTTP APIs |
Expand Down
50 changes: 50 additions & 0 deletions schemas/ietf/language/tag-syntax.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "RFC 5646 BCP 47 Language Tag",
"description": "A language tag conforming to language tag full syntax at the syntax level only",
"examples": [
"en",
"en-US",
"zh-Hans",
"sr-Latn-RS",
"de-CH-1996",
"zh-cmn-Hans-CN",
"en-US-x-twain",
"x-private"
],
"x-license": "https://github.com/sourcemeta/std/blob/main/LICENSE",
"x-links": [ "https://www.rfc-editor.org/rfc/rfc5646" ],
"type": "string",
"anyOf": [
{
"$comment": "Regular language tag: language [-script] [-region] [*-variant] [*-extension] [-privateuse]",
"pattern": "^([A-Za-z]{2,3}(-[A-Za-z]{3}){0,3}|[A-Za-z]{4}|[A-Za-z]{5,8})(-[A-Za-z]{4})?(-([A-Za-z]{2}|[0-9]{3}))?(-([0-9][a-zA-Z0-9]{3}|[a-zA-Z0-9]{5,8}))*(-[0-9A-WY-Za-wy-z](-[a-zA-Z0-9]{2,8})+)*(-[Xx](-[a-zA-Z0-9]{1,8})+)?$"
},
{
"$comment": "Private use tag: x-privateuse",
"pattern": "^[Xx](-[a-zA-Z0-9]{1,8})+$"
},
{
"$comment": "Grandfathered irregular tags (RFC 3066 legacy)",
"enum": [
"en-GB-oed",
"i-ami",
"i-bnn",
"i-default",
"i-enochian",
"i-hak",
"i-klingon",
"i-lux",
"i-mingo",
"i-navajo",
"i-pwn",
"i-tao",
"i-tay",
"i-tsu",
"sgn-BE-FR",
"sgn-BE-NL",
"sgn-CH-DE"
]
}
]
}
Loading