Skip to content
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

contentLang property #114

Closed
brettz9 opened this issue Oct 28, 2016 · 6 comments
Closed

contentLang property #114

brettz9 opened this issue Oct 28, 2016 · 6 comments

Comments

@brettz9
Copy link

brettz9 commented Oct 28, 2016

(Filing as a separate issue as per #53 (comment) )

As with HTML's lang/xml:lang properties, it would be useful to indicate the content language of a particular field in a standard manner. This might be used for proper font display (as in CJK languages) or for selectively showing content to users based on their locale.

I think a name "contentLang" for the property would avoid confusion at (falsely) thinking that this was necessarily indicating the language of the "title" or "description" itself.

Although it is probably not a feature that would be used for validation (since looking at code points might not be reliable or valid such such detection), contentLang does describe the data, placing constraints on how it is to be understood which brings it more into the world of schemas (unlike i18n of the schema itself).

Note that JSON-LD would not solve this unless one uses JSON-LD in the instance documents (which would prevent the benefit of having such a pseudo-constraint at the schema level).

@handrews
Copy link
Contributor

Would this make more sense as part of a JSON UI Schema? (see #67 )

@brettz9
Copy link
Author

brettz9 commented Oct 28, 2016

It may have a bearing on view so I can see that argument, but it is essentially related to describing the content.

In my view, it would make more sense if it were added to the validation spec, though mentioning that no specific validation requirements are added thereby, and with the UI schema mentioning that contentLang ought to be leveraged for such as <html lang> (so as to support the proper font display) and optionally utilized by user agents in choosing which contentLang content (if any), ought to be displayed by default for the user (e.g., allowing the default hiding of content for languages not in the current locale(s) with the option given to the user to selectively re-enable any number of other contentLang content).

@Relequestual
Copy link
Member

Mmm. Initially I didn't feel like this should be in JSON Schema, but annotation is part of the remit. I don't see a problem with this.

@handrews
Copy link
Contributor

See this thread which collects a bunch of proposals relevant to this:
https://groups.google.com/forum/#!topic/json-schema/cG4HAyerqQk

@handrews
Copy link
Contributor

This may make sense in the proposed annotation/meta-data spec #136 which would quite likely be where the current meta-data section in the validation spec would end up.

@philsturgeon
Copy link
Collaborator

Let's combine this suggestion with the conversations about a i18n vocab: json-schema-org/json-schema-vocabularies#10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants