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

Add section on setting the text direction #137

Merged
merged 4 commits into from
Dec 18, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions draft/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ <h3>Service Manifest</h3>
<dd>The maximum number of <a>reconciliation queries</a> in a single <a>reconciliation query batch</a>. The service MAY respond to batches larger than this number with a 413 HTTP error status code [[RFC7231]]</dd>
<dt><code>authentication</code></dt>
<dd>An <a>security scheme</a>, supplied if the service supports <a href="#authentication">authentication</a>.</dd>
<dt><code>dir</code></dt>
<dd>An optional value for the default <a href="#text-direction">text direction</a> used by this service.</dd>
</dl>
</p>
<p>For instance, a service could expose the following minimal service manifest:
Expand Down Expand Up @@ -939,6 +941,18 @@ <h3>Text-processing language</h3>

<p>If no explicit text-processing language is given, the first <a href="#language-of-the-intended-audience">language of the intended audience</a> returned by the service is considered the default text-processing language.</p>
</section>
<section>
<h3>Text direction</h3>

<p>All objects returned by reconciliation services (entities, types, properties, candidates, features, etc.) MAY declare an explicit text <a href="https://www.w3.org/International/articles/inline-bidi-markup/uba-basics">
base direction</a> in a <code>dir</code> field. The <code>dir</code> value MUST be <code>ltr</code> for left-to-right, <code>rtl</code> for right-to-left, or <code>auto</code> for determining the direction by examining the content of each JSON field.
This base direction applies to the natural language fields of the object: <code>name</code> and <code>description</code> (for candidates etc.), <code>v</code> and <code>str</code> (for <a>property values</a>).
Nested objects inherit the base direction of their parent, and can override it by setting their own <code>dir</code> value. A default base direction for any natural language string returned by a service can be set in the <code>dir</code> field of the
<a href="#service-manifest">service manifest</a>. Clients SHOULD consider the base direction to ensure correct rendering of content, e.g. by setting corresponding <code>dir</code> attributes when rendering JSON responses in HTML.
For instance, rendering a Persian label for 'Yahoo!' like <code>یاهو!</code> right-to-left will correctly display as <code dir="rtl">یاهو!</code>.</p>

<p>If no explicit base direction is given, left-to-right is considered the default base direction.</p>
</section>
</section>
<section>
<h2>Accessibility Considerations</h2>
Expand Down