json-schema-spec
json-schema-spec copied to clipboard
Proposal: Language annotation keyword
This keyword would belong to the Meta-Data vocabulary and would set the language of a JSON string as an ISO 639-1 language code. For example:
{
"type": "string",
"language": "en_US"
}
The use case where this came up is applying textual dictionary compression formats optimized for prose which may take a language as an optimization hint.
"language" isn't a term with a precise definition, but "locale" is.
"language" isn't a term with a precise definition, but "locale" is.
RFC 5646, probably the most well-known standard in this area, is called "Tags for Identifying Languages". That standard uses "locale" 10 times and "language" almost 900 times.
A project I'm part of wants to use RFC 5646 language tags in a property to inform users of the contents of geospatial dataset assets. I'm going to implement this as an enum, but this seems like it would be a good candidate for a JSON Schema format. Would this be something you'd be interested in as a PR?
I'm closing this old issue in the spirit of helping cleaning up the spec issue tracker. We can move to GitHub Discussions if this is something people are ever interested in for the official vocabularies.