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

Comments

Projects
None yet
6 participants
@r12a

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

This comment has been minimized.

Show comment
Hide comment
@akuckartz

akuckartz Aug 16, 2016

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.

akuckartz commented Aug 16, 2016

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

This comment has been minimized.

Show comment
Hide comment
@r12a

r12a Aug 16, 2016

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

r12a commented Aug 16, 2016

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

@evanp

This comment has been minimized.

Show comment
Hide comment
@evanp

evanp Aug 31, 2016

Collaborator

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?

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

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Aug 31, 2016

Collaborator

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.

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

This comment has been minimized.

Show comment
Hide comment
@evanp

evanp Aug 31, 2016

Collaborator

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

http://tinyurl.com/j3eww25

versus

http://tinyurl.com/jg53eyh

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 Aug 31, 2016

@evanp evanp reopened this Aug 31, 2016

@evanp

This comment has been minimized.

Show comment
Hide comment
@evanp

evanp Aug 31, 2016

Collaborator

Accidentally closed

Collaborator

evanp commented Aug 31, 2016

Accidentally closed

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Aug 31, 2016

Collaborator

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.

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

This comment has been minimized.

Show comment
Hide comment
@akuckartz

akuckartz Sep 3, 2016

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

akuckartz commented Sep 3, 2016

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

@sandhawke

This comment has been minimized.

Show comment
Hide comment
@sandhawke

This comment has been minimized.

Show comment
Hide comment
@sandhawke

sandhawke Nov 18, 2016

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

Contributor

sandhawke commented Nov 18, 2016

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