Skip to content

Commit

Permalink
Merge pull request #2026 from w3c/ege-text-direction
Browse files Browse the repository at this point in the history
Informative steps to implement text direction parsing in Consumers
  • Loading branch information
egekorkan authored Jun 5, 2024
2 parents 0a43ee7 + 5e1822b commit 0f79277
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
29 changes: 27 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4831,9 +4831,34 @@ <h3>Human-Readable Metadata</h3>
For the MultiLanguage <a>Map</a>, TD Consumers MAY infer the
<a class="lint-ignore">base direction</a> from the language tag of the individual strings.
</span>
The example below illustrates the use of the <code>@direction</code> term. See [[?json-ld11]] and
[[string-meta]] for more detailed information.
These can be summarized into the steps below that can be implemented by TD Consumers based on the
information provided in a TD.
</p>
<ol>
<li>
<b>File-level metadata:</b> Use the values of <code>@direction</code> found in the <code>@context</code>.
</li>
<li>
<b>Guess from language:</b> Use the value of <code>@language</code> and then guess the direction of the
text
</li>
<li>
<b>First-strong:</b>Use the first strongly-directional character in a string. This is equivalent to using
<code>dir=auto</code> in HTML attributes.
</li>
</ol>

<p class="note">
Please note string-specific direction metadata is not possible in the current version of the specification.
The working group is working on a mechanism to make it possible. After which, that will be the preferred way
to handle text direction for TD Consumers.
</p>

<p>
Additionally, the example below illustrates the use of the <code>@direction</code> and
<code>@language</code> terms. See [[?json-ld11]] and [[string-meta]] for more detailed information.
</p>

<pre class="example">
{
"@context": [
Expand Down
29 changes: 27 additions & 2 deletions index.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -1836,9 +1836,34 @@ <h3>Human-Readable Metadata</h3>
For the MultiLanguage <a>Map</a>, TD Consumers MAY infer the
<a class="lint-ignore">base direction</a> from the language tag of the individual strings.
</span>
The example below illustrates the use of the <code>@direction</code> term. See [[?json-ld11]] and
[[string-meta]] for more detailed information.
These can be summarized into the steps below that can be implemented by TD Consumers based on the
information provided in a TD.
</p>
<ol>
<li>
<b>File-level metadata:</b> Use the values of <code>@direction</code> found in the <code>@context</code>.
</li>
<li>
<b>Guess from language:</b> Use the value of <code>@language</code> and then guess the direction of the
text
</li>
<li>
<b>First-strong:</b>Use the first strongly-directional character in a string. This is equivalent to using
<code>dir=auto</code> in HTML attributes.
</li>
</ol>

<p class="note">
Please note string-specific direction metadata is not possible in the current version of the specification.
The working group is working on a mechanism to make it possible. After which, that will be the preferred way
to handle text direction for TD Consumers.
</p>

<p>
Additionally, the example below illustrates the use of the <code>@direction</code> and
<code>@language</code> terms. See [[?json-ld11]] and [[string-meta]] for more detailed information.
</p>

<pre class="example">
{
"@context": [
Expand Down

0 comments on commit 0f79277

Please sign in to comment.