Skip to content

Commit e24289d

Browse files
gkelloggafsaphillipsTallTed
authored
Add a further explanation of ltr and rtl (based on ePub). (#109)
* Add a further explanation on `ltr` and `rtl` (based on ePub). Suggested by w3c/rdf-turtle#75. * Add example of displaying right-to-left text in its natural order vs the way it is stored in memory. * Update I18N description of implicit initial text direction * Use I18N-Glossary instead of UAX9 and UAX15 references. --------- Co-authored-by: Andy Seaborne <[email protected]> Co-authored-by: Addison Phillips <[email protected]> Co-authored-by: Ted Thibodeau Jr <[email protected]>
1 parent f0ce6fc commit e24289d

File tree

1 file changed

+31
-12
lines changed

1 file changed

+31
-12
lines changed

spec/index.html

+31-12
Original file line numberDiff line numberDiff line change
@@ -707,8 +707,7 @@ <h3>IRIs</h3>
707707
<code>%3f</code>”)</li>
708708
<li>Punycode-encoding of Internationalized Domain Names
709709
in IRIs [[RFC3492]]</li>
710-
<li>IRIs that are not in Unicode
711-
<a class="lint-ignore">Normalization Form C</a> [[UAX15]]</li>
710+
<li>IRIs that are not in Unicode [=Normalization Form C=] [[I18N-Glossary]]</li>
712711
</ul>
713712
</div>
714713
</section>
@@ -759,6 +758,12 @@ <h2>Literals</h2>
759758
The third element, the language tag, is treated identically as in a <a>language-tagged string</a>,
760759
and the fourth element, <a>base direction</a>, MUST be either `ltr` or `rtl`, which MUST be in lower case.</p>
761760

761+
<p>The meanings of the <a>base direction</a> values are:</p>
762+
<ul>
763+
<li>`ltr`: indicates that the initial text direction is set to left-to-right.</li>
764+
<li>`rtl`: indicates that the initial text direction is set to right-to-left.</li>
765+
</ul>
766+
762767
<p>Please note that concrete syntaxes MAY support
763768
<dfn data-lt="simple literal" class="export">simple literals</dfn> consisting of only a
764769
<a>lexical form</a> without any <a>datatype IRI</a>, <a>language tag</a>, or <a>base direction</a>.
@@ -806,14 +811,15 @@ <h2>Literals</h2>
806811

807812
<p><dfn data-local-lt="term-equal">Literal term equality</dfn>:
808813
Two literals are term-equal (the same <a>RDF literal</a>)
809-
if and only if:
810-
<ul>
811-
<li>the two <a>lexical forms</a> compare equal</li>
812-
<li>the two <a>datatype IRIs</a> compare equal</li>
813-
<li>the two <a>language tags</a> (if any) compare equal</li>
814-
<li>the two <a>base directions</a> (if any) compare equal</li>
815-
</ul>
816-
Comparison is performed using
814+
if and only if:</p>
815+
816+
<ul>
817+
<li>the two <a>lexical forms</a> compare equal</li>
818+
<li>the two <a>datatype IRIs</a> compare equal</li>
819+
<li>the two <a>language tags</a> (if any) compare equal</li>
820+
<li>the two <a>base directions</a> (if any) compare equal</li>
821+
</ul>
822+
<p>Comparison is performed using
817823
<a data-cite="I18N-GLOSSARY#dfn-case-sensitive">case sensitive matching</a>
818824
(see description of string comparison in
819825
<a href="#rdf-strings" class="sectionRef"></a>)
@@ -839,7 +845,7 @@ <h3>Initial Text Direction</h3>
839845
<p>The <a>base direction</a> of a <a>directional language-tagged string</a>
840846
provides a means of establishing the initial direction of text,
841847
including text which is a mixture of right-to-left and left-to-right scripts.
842-
The [[[?UAX9]]] [[?UAX9]] provides support for automatically rendering
848+
The [=Unicode Bidirectional Algorithm=] [[?I18N-Glossary]] provides support for automatically rendering
843849
a sequence of characters in logical order,
844850
so that they are visually ordered as expected,
845851
but this is not sufficient to correctly render bidirectional text.</p>
@@ -851,6 +857,19 @@ <h3>Initial Text Direction</h3>
851857
HTML's `dir` attribute) it can then be correctly presented as:
852858
</p>
853859
<div lang="he" dir="rtl">פעילות הבינאום, W3C</div>
860+
861+
<p>In the absence of an explicit initial text direction,
862+
the [=Unicode Bidirectional Algorithm=] detects the text direction from the content.
863+
This depends on the first strongly directional character in the text
864+
or on the context.
865+
To avoid [=spillover effects=], users need to employ [=bidi isolation=]
866+
whenever text is inserted into a larger document.
867+
For example,
868+
&quot;<code>&lt;bdi lang="he"&gt;ספרים בינלאומיים!&lt;/bdi&gt;</code>&quot;
869+
displays the Hebrew characters in a right-to-left fashion
870+
— i.e., as &quot;<bdi lang="he">ספרים בינלאומיים!</bdi>&quot;
871+
— while they would be stored in memory as
872+
&quot;<bdo dir="ltr" lang="he">ספרים בינלאומיים!</bdo>&quot;</p>
854873
</section>
855874
</section>
856875

@@ -1687,7 +1706,7 @@ <h2>Security Considerations</h2>
16871706
<section id="internationalization" class="appendix informative">
16881707
<h2>Internationalization Considerations</h2>
16891708
<p>Unicode [[UNICODE]] provides a mechanism for signaling direction within a string
1690-
(see [[[UAX9]]] [[UAX9]]).
1709+
(see [=Unicode Bidirectional Algorithm=] [[I18N-Glossary]]).
16911710
RDF provides a mechanism for specifying the <a>base direction</a>
16921711
of a <a>directional language-tagged string</a>
16931712
to signal the initial text direction of a string.

0 commit comments

Comments
 (0)