-
Notifications
You must be signed in to change notification settings - Fork 24
Specs handling text direction
r12a edited this page Jul 29, 2016
·
25 revisions
- this is JSON
- 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
for the name property (no markup allowed) add control codes at start and end of value for overall base direction and inline control codes for inline changes
Example 133
{
"@context": {
"@value": "http://www.w3.org/ns/activitystreams",
"@language": "he"
},
"name": "פעילות הבינאום, W3C",
"type": "Note",
"summary": "פעילות הבינאום, W3C"
}
for summary and content properties, use markup with dir attributes to establish overall base direction and inline changes
Example 134
{
"@context": {
"@value": "http://www.w3.org/ns/activitystreams",
"@language": "he"
},
"name": "פעילות הבינאום, W3C",
"type": "Note",
"summaryMap": {
"en": "A simple <em>note</em>",
"es": "Una <em>nota</em> sencilla",
"he": "פעילות הבינאום, W3C"
}
}
- can't expect users to add control characters or markup for default direction for every natural language string
- users are expected to use different approaches for notes vs summary/content, which is confusing
- all the usual problems with control codes (eg. difficult to use, may not be available on keyboard, even harder to edit, etc.)
- specify that the default is LTR
- use one property per object to establish the base direction for RTL text
- user only needs to revert to RLM/LRM only for exceptional text
- if property value says auto, does FS analysis
- setting a property is possibly more helpful when dealing with input from HTML forms, etc, where the direction information is carried separately from the text (dirname)