diff --git a/draft/examples/data-extension-response/valid/example-dir.json b/draft/examples/data-extension-response/valid/example-dir.json new file mode 100644 index 0000000..628c0b2 --- /dev/null +++ b/draft/examples/data-extension-response/valid/example-dir.json @@ -0,0 +1,37 @@ +{ + "meta": [ + { + "id": "Len", + "name": "Label (for language code 'en')" + }, + { + "id": "Afa", + "name": "Also known as (for language code 'fa')" + } + ], + "rows": [ + { + "id": "Q37093", + "dir": "ltr", + "properties": [ + { + "id": "Len", + "values": [ + { + "str": "Yahoo!" + } + ] + }, + { + "id": "Afa", + "values": [ + { + "str": "یاهو!", + "dir": "rtl" + } + ] + } + ] + } + ] +} diff --git a/draft/index.html b/draft/index.html index 3ea52e6..ebe84f9 100644 --- a/draft/index.html +++ b/draft/index.html @@ -405,6 +405,8 @@

Service Manifest

An security scheme, supplied if the service supports authentication.
lang
An optional value for the default text-processing language used by this service.
+
dir
+
An optional value for the default text direction used by this service.

For instance, a service could expose the following minimal service manifest: @@ -953,6 +955,23 @@

Text-processing language

+
+

Text direction

+ +

All objects returned by reconciliation services (entities, types, properties, candidates, features, etc.) MAY declare an explicit text + base direction in a dir field. The dir value MUST be ltr for left-to-right, rtl for right-to-left, or auto for determining the direction by examining the content of each JSON field. + This base direction applies to the natural language fields of the object: name and description (for candidates etc.), v and str (for property values). + Nested objects inherit the base direction of their parent, and can override it by setting their own dir value. A default base direction for any natural language string returned or processed by a service MAY be set in the dir field of the + service manifest. If no explicit base direction is given, left-to-right is considered the default base direction. Clients SHOULD consider the base direction to ensure correct rendering of content, e.g. by setting corresponding dir attributes when rendering JSON responses in HTML. + For instance, rendering a Persian label for 'Yahoo!' like یاهو! right-to-left will correctly display as یاهو!.

+ +

In the following example, we first set the base direction for a data extension response row to ltr, which is inherited by the first property, and overridden in the second property with rtl:

+ +

+


+        

+ +

Accessibility Considerations

diff --git a/draft/schemas/data-extension-response.json b/draft/schemas/data-extension-response.json index e2715c4..22e9db7 100644 --- a/draft/schemas/data-extension-response.json +++ b/draft/schemas/data-extension-response.json @@ -82,6 +82,9 @@ }, "lang": { "type": "string" + }, + "dir": { + "type": "string" } }, "required": [ @@ -98,6 +101,9 @@ }, "lang": { "type": "string" + }, + "dir": { + "type": "string" } }, "required": [