Skip to content

Specs handling text direction

r12a edited this page Jul 29, 2016 · 25 revisions

Activity Streams

Example 133

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "name": "פעילות הבינאום, W3C",
  "type": "Note",
  "summary": "A simple <em>note</em>"
}
Example 134

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "name": "A simple note",
  "type": "Note",
  "summaryMap": {
    "en": "A simple <em>note</em>",
    "es": "Una <em>nota</em> sencilla",
    "zh-Hans": "一段<em>简单的</em>笔记"
  }
}

Notes:

  • this is JSON-LD
  • it's sent as single items
  • structured objects
  • only some strings are natural language
  • includes a mechanism for localised text
  • name property has no markup
  • summary and others do support HTML markup
  • an object can contains several natural language strings, which may have different base directions
  • either a summaryMap should become several objects, or FS will need to be used
  • the name property admits no markup, so control codes need to be used - otherwise, use markup for inline changes

Current solution proposed by WG:

for the name property (no markup allowed) add control codes at start and end of value

Example 133

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "name": "A simple note",
  "type": "Note",
  "summary": "A simple <em>note</em>"
}

for other properties with natural language values, use markup with dir attributes

Example 134

{
  "@context": "http://www.w3.org/ns/activitystreams",
  "name": "A simple note",
  "type": "Note",
  "summaryMap": {
    "en": "A simple <em>note</em>",
    "es": "Una <em>nota</em> sencilla",
    "zh-Hans": "一段<em>简单的</em>笔记"
  }
}