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

Default Language Context MAY -> SHOULD #354

Closed
r12a opened this issue Aug 16, 2016 · 10 comments
Closed

Default Language Context MAY -> SHOULD #354

r12a opened this issue Aug 16, 2016 · 10 comments

Comments

@r12a
Copy link

r12a commented Aug 16, 2016

This is a comment on #352 (raised here so that i18n folks are notified).

The section Default Language Context says:

When using [[JSON-LD]] mechanisms to produce or consume Activity Streams 2.0 documents, the @language property MAY be used within a @context to identify the default language. This mechanism may not be understood by implementations that do not choose to process Activity Streams 2.0 documents using JSON-LD.

We were previously explaining that associating language with strings is often necessary when it comes to presenting them to a user (eg. to prevent Chinese users being presented with Japanese font glyphs). Could we either change MAY to SHOULD, or at least add a note to say that actually language information is quite important (since very few developers seem to recognise that)?

@akuckartz
Copy link

It is not necessary to provide that property in the context to associate all strings with a language. But I agree that such a note might be helpfull.

@r12a
Copy link
Author

r12a commented Aug 16, 2016

Ah yes, i follow your reasoning. Perhaps a note then?

@evanp
Copy link
Collaborator

evanp commented Aug 31, 2016

So, I think this is a valid Activity Streams document:

{
  "@context": "https://www.w3.org/ns/activitystreams",
  "@language": "fr",
  "type": "Note",
  "name": "Une note brève"
}

I vastly prefer this to the version with @language inside the @context, which seems kind of complex.

@jasnell If this is the case, maybe we can just recommend that documents SHOULD include the @language property and be done with it?

@jasnell
Copy link
Collaborator

jasnell commented Aug 31, 2016

While this is valid, having the @language here would have no effect when it comes to JSON-LD processing. The @language needs to either be in the @context or inside a "value object" like "name": {'@language': 'en', '@value': 'Une note brève}`. The latter is a form we don't want to promote and currently rule out in our syntax because of the additional parsing complexity is requires.

@evanp
Copy link
Collaborator

evanp commented Aug 31, 2016

It's interesting how the JSON-LD playground handles it:

http://tinyurl.com/j3eww25

versus

http://tinyurl.com/jg53eyh

@evanp evanp closed this as completed Aug 31, 2016
@evanp evanp reopened this Aug 31, 2016
@evanp
Copy link
Collaborator

evanp commented Aug 31, 2016

Accidentally closed

@jasnell
Copy link
Collaborator

jasnell commented Aug 31, 2016

Yeah, if you look at the normalized result for the first, you'll see that the @language is lost entirely. That's because it is treated as a non-declared extension property that is simply ignored by the JSON-LD processing.

@akuckartz
Copy link

@lanthaler Do you have any suggestion or opinion regarding this issue ?

@sandhawke
Copy link
Contributor

@sandhawke
Copy link
Contributor

RESOLVED: Resolve issue #354 of Activity Streams with a SHOULD that points out the importance of explicitly marking up language of natural language properties if you know the language, and use such markup for some examples, and points out that it's not in every example because we want to avoid the copypaste EN everywhere thing

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

6 participants