json-schema-spec icon indicating copy to clipboard operation
json-schema-spec copied to clipboard

Proposal: Language annotation keyword

Open jviotti opened this issue 4 years ago • 3 comments

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.

jviotti avatar Sep 14 '21 17:09 jviotti

"language" isn't a term with a precise definition, but "locale" is.

karenetheridge avatar Sep 14 '21 17:09 karenetheridge

"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.

l0b0 avatar Nov 18 '21 02:11 l0b0

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?

l0b0 avatar Nov 18 '21 02:11 l0b0

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.

jviotti avatar Aug 15 '22 22:08 jviotti