From ef0c93f8ead2fcdafee1503b9dbafb6502bcb14d Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Thu, 24 Oct 2024 15:40:56 -0700 Subject: [PATCH 01/10] Add a further explaination on `ltr` and `rtl` (based on ePub). Suggested by w3c/rdf-turtle#75. --- spec/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/index.html b/spec/index.html index e1112e2..e06749a 100644 --- a/spec/index.html +++ b/spec/index.html @@ -759,6 +759,12 @@ <h2>Literals</h2> The third element, the language tag, is treated identically as in a <a>language-tagged string</a>, and the fourth element, <a>base direction</a>, MUST be either `ltr` or `rtl`, which MUST be in lower case.</p> + <p>The meanings of the <a>base direction</a> values are:</p> + <ul> + <li>`ltr`: indicates that the textual value is explicitly directionally set to left-to-right text.</li> + <li>`rtl`: indicates that the textual value is explicitly directionally set to right-to-left text.</li> + </ul> + <p>Please note that concrete syntaxes MAY support <dfn data-lt="simple literal" class="export">simple literals</dfn> consisting of only a <a>lexical form</a> without any <a>datatype IRI</a>, <a>language tag</a>, or <a>base direction</a>. From d9980e0381b2d106e44b18dd68721e5f1a373929 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Fri, 25 Oct 2024 11:35:33 -0700 Subject: [PATCH 02/10] Change description for `ltr` and `rtl`. Co-authored-by: Andy Seaborne <andy@apache.org> --- spec/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.html b/spec/index.html index e06749a..6c5e190 100644 --- a/spec/index.html +++ b/spec/index.html @@ -761,8 +761,8 @@ <h2>Literals</h2> <p>The meanings of the <a>base direction</a> values are:</p> <ul> - <li>`ltr`: indicates that the textual value is explicitly directionally set to left-to-right text.</li> - <li>`rtl`: indicates that the textual value is explicitly directionally set to right-to-left text.</li> + <li>`ltr`: indicates that the initial text direction is set to left-to-right text.</li> + <li>`rtl`: indicates that the initial text direction is set to right-to-left text.</li> </ul> <p>Please note that concrete syntaxes MAY support From 93e44b55207e78d79c26204890629b6cc13c4878 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Fri, 25 Oct 2024 12:56:48 -0700 Subject: [PATCH 03/10] Add example of displaying right-to-left text in its natural order vs the way it is stored in memory. --- spec/index.html | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/index.html b/spec/index.html index 6c5e190..1bb63d7 100644 --- a/spec/index.html +++ b/spec/index.html @@ -857,6 +857,12 @@ <h3>Initial Text Direction</h3> HTML's `dir` attribute) it can then be correctly presented as: </p> <div lang="he" dir="rtl">פעילות הבינאום, W3C</div> + + <p>In the absense of an explicit initial text direction, the [[?UAX9]] algorithm + can detect text direction from the initial character. + For example "<bdi lang="ar">اَلأَعْشَى</bdi> - 1st place" displays the + aarabic characters in a right-to-left fashion, while in memory + they would be stored as "<bdo lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> </section> </section> From 0bd3b8b77cdf1e818b2b91f8d83eda034136414c Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Fri, 25 Oct 2024 13:09:51 -0700 Subject: [PATCH 04/10] Fix markup errors. --- spec/index.html | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/spec/index.html b/spec/index.html index 1bb63d7..b9751e5 100644 --- a/spec/index.html +++ b/spec/index.html @@ -812,14 +812,15 @@ <h2>Literals</h2> <p><dfn data-local-lt="term-equal">Literal term equality</dfn>: Two literals are term-equal (the same <a>RDF literal</a>) - if and only if: - <ul> - <li>the two <a>lexical forms</a> compare equal</li> - <li>the two <a>datatype IRIs</a> compare equal</li> - <li>the two <a>language tags</a> (if any) compare equal</li> - <li>the two <a>base directions</a> (if any) compare equal</li> - </ul> - Comparison is performed using + if and only if:</p> + + <ul> + <li>the two <a>lexical forms</a> compare equal</li> + <li>the two <a>datatype IRIs</a> compare equal</li> + <li>the two <a>language tags</a> (if any) compare equal</li> + <li>the two <a>base directions</a> (if any) compare equal</li> + </ul> + <p>Comparison is performed using <a data-cite="I18N-GLOSSARY#dfn-case-sensitive">case sensitive matching</a> (see description of string comparison in <a href="#rdf-strings" class="sectionRef"></a>) @@ -862,7 +863,7 @@ <h3>Initial Text Direction</h3> can detect text direction from the initial character. For example "<bdi lang="ar">اَلأَعْشَى</bdi> - 1st place" displays the aarabic characters in a right-to-left fashion, while in memory - they would be stored as "<bdo lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> + they would be stored as "<bdo dir="ltr" lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> </section> </section> From ecf192f3201b95de631828b234983643da729aaf Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Fri, 25 Oct 2024 15:50:06 -0700 Subject: [PATCH 05/10] Apply suggestions from code review --- spec/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.html b/spec/index.html index b9751e5..a36527f 100644 --- a/spec/index.html +++ b/spec/index.html @@ -859,10 +859,10 @@ <h3>Initial Text Direction</h3> </p> <div lang="he" dir="rtl">פעילות הבינאום, W3C</div> - <p>In the absense of an explicit initial text direction, the [[?UAX9]] algorithm + <p>In the absence of an explicit initial text direction, the [[?UAX9]] algorithm can detect text direction from the initial character. For example "<bdi lang="ar">اَلأَعْشَى</bdi> - 1st place" displays the - aarabic characters in a right-to-left fashion, while in memory + Arabic characters in a right-to-left fashion, while in memory they would be stored as "<bdo dir="ltr" lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> </section> </section> From 69102f3208495b6b319de398ce5c2c89e54daf71 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Mon, 28 Oct 2024 16:25:46 -0700 Subject: [PATCH 06/10] Update I18N description of implicit initial text direction Co-authored-by: Addison Phillips <addisonI18N@gmail.com> --- spec/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/index.html b/spec/index.html index a36527f..58fda1d 100644 --- a/spec/index.html +++ b/spec/index.html @@ -859,8 +859,12 @@ <h3>Initial Text Direction</h3> </p> <div lang="he" dir="rtl">פעילות הבינאום, W3C</div> - <p>In the absence of an explicit initial text direction, the [[?UAX9]] algorithm - can detect text direction from the initial character. + <p>In the absence of an explicit initial text direction, + the [=Unicode Bidirectional Algorithm=] detects the text direction from the content. + This depends on the first strongly directional character in the text + or on the context. + Users need to provide [=bidi isolation=] whenever text is inserted into a larger document + in order to avoid [=spillover effects=]. For example "<bdi lang="ar">اَلأَعْشَى</bdi> - 1st place" displays the Arabic characters in a right-to-left fashion, while in memory they would be stored as "<bdo dir="ltr" lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> From 42eff58e897b641e242a0ff1c17e763bdfc29be7 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Mon, 28 Oct 2024 16:28:04 -0700 Subject: [PATCH 07/10] Tweak language on left-to-right/right-to-left. Co-authored-by: Addison Phillips <addisonI18N@gmail.com> --- spec/index.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/index.html b/spec/index.html index 58fda1d..f048ce1 100644 --- a/spec/index.html +++ b/spec/index.html @@ -761,8 +761,8 @@ <h2>Literals</h2> <p>The meanings of the <a>base direction</a> values are:</p> <ul> - <li>`ltr`: indicates that the initial text direction is set to left-to-right text.</li> - <li>`rtl`: indicates that the initial text direction is set to right-to-left text.</li> + <li>`ltr`: indicates that the initial text direction is set to left-to-right.</li> + <li>`rtl`: indicates that the initial text direction is set to right-to-left.</li> </ul> <p>Please note that concrete syntaxes MAY support From e4a51e762278f1644cd3d4a56f531c0b1e735807 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Mon, 28 Oct 2024 16:21:35 -0700 Subject: [PATCH 08/10] Use I18N-Glossary instead of UAX9 and UAX15 references. --- spec/index.html | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/spec/index.html b/spec/index.html index f048ce1..0443c06 100644 --- a/spec/index.html +++ b/spec/index.html @@ -707,8 +707,7 @@ <h3>IRIs</h3> “<code>%3f</code>”)</li> <li>Punycode-encoding of Internationalized Domain Names in IRIs [[RFC3492]]</li> - <li>IRIs that are not in Unicode - <a class="lint-ignore">Normalization Form C</a> [[UAX15]]</li> + <li>IRIs that are not in Unicode [=Normalization Form C=] [[I18N-Glossary]]</li> </ul> </div> </section> @@ -846,7 +845,7 @@ <h3>Initial Text Direction</h3> <p>The <a>base direction</a> of a <a>directional language-tagged string</a> provides a means of establishing the initial direction of text, including text which is a mixture of right-to-left and left-to-right scripts. - The [[[?UAX9]]] [[?UAX9]] provides support for automatically rendering + The [=Unicode Bidirectional Algorithm=] [[?I18N-Glossary]] provides support for automatically rendering a sequence of characters in logical order, so that they are visually ordered as expected, but this is not sufficient to correctly render bidirectional text.</p> @@ -860,11 +859,11 @@ <h3>Initial Text Direction</h3> <div lang="he" dir="rtl">פעילות הבינאום, W3C</div> <p>In the absence of an explicit initial text direction, - the [=Unicode Bidirectional Algorithm=] detects the text direction from the content. - This depends on the first strongly directional character in the text - or on the context. - Users need to provide [=bidi isolation=] whenever text is inserted into a larger document - in order to avoid [=spillover effects=]. + the [=Unicode Bidirectional Algorithm=] detects the text direction from the content. + This depends on the first strongly directional character in the text + or on the context. + Users need to provide [=bidi isolation=] whenever text is inserted into a larger document + in order to avoid [=spillover effects=]. For example "<bdi lang="ar">اَلأَعْشَى</bdi> - 1st place" displays the Arabic characters in a right-to-left fashion, while in memory they would be stored as "<bdo dir="ltr" lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> @@ -1704,7 +1703,7 @@ <h2>Security Considerations</h2> <section id="internationalization" class="appendix informative"> <h2>Internationalization Considerations</h2> <p>Unicode [[UNICODE]] provides a mechanism for signaling direction within a string - (see [[[UAX9]]] [[UAX9]]). + (see [=Unicode Bidirectional Algorithm=] [[I18N-Glossary]]). RDF provides a mechanism for specifying the <a>base direction</a> of a <a>directional language-tagged string</a> to signal the initial text direction of a string. From 4a2d2afe53c6fcde4058cb92c47e7f783fb31f9b Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Mon, 28 Oct 2024 16:45:12 -0700 Subject: [PATCH 09/10] Update Arabic exammple to Hebrew. --- spec/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/index.html b/spec/index.html index 0443c06..d96ebef 100644 --- a/spec/index.html +++ b/spec/index.html @@ -864,9 +864,9 @@ <h3>Initial Text Direction</h3> or on the context. Users need to provide [=bidi isolation=] whenever text is inserted into a larger document in order to avoid [=spillover effects=]. - For example "<bdi lang="ar">اَلأَعْشَى</bdi> - 1st place" displays the - Arabic characters in a right-to-left fashion, while in memory - they would be stored as "<bdo dir="ltr" lang="ar">اَلأَعْشَى</bdo> - 1st place"</p> + For example "<bdi lang="he">ספרים בינלאומיים!</bdi>" displays the + Hebrew characters in a right-to-left fashion, while in memory + they would be stored as "<bdo dir="ltr" lang="he">ספרים בינלאומיים!</bdo>"</p> </section> </section> From 038ffc5b5a56a8d0db8c9f05bb15edd09a1cd737 Mon Sep 17 00:00:00 2001 From: Gregg Kellogg <gregg@greggkellogg.net> Date: Tue, 29 Oct 2024 09:17:49 -0700 Subject: [PATCH 10/10] bidi isolation Co-authored-by: Ted Thibodeau Jr <tthibodeau@openlinksw.com> --- spec/index.html | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spec/index.html b/spec/index.html index d96ebef..63b7b46 100644 --- a/spec/index.html +++ b/spec/index.html @@ -862,11 +862,14 @@ <h3>Initial Text Direction</h3> the [=Unicode Bidirectional Algorithm=] detects the text direction from the content. This depends on the first strongly directional character in the text or on the context. - Users need to provide [=bidi isolation=] whenever text is inserted into a larger document - in order to avoid [=spillover effects=]. - For example "<bdi lang="he">ספרים בינלאומיים!</bdi>" displays the - Hebrew characters in a right-to-left fashion, while in memory - they would be stored as "<bdo dir="ltr" lang="he">ספרים בינלאומיים!</bdo>"</p> + To avoid [=spillover effects=], users need to employ [=bidi isolation=] + whenever text is inserted into a larger document. + For example, + "<code><bdi lang="he">ספרים בינלאומיים!</bdi></code>" + displays the Hebrew characters in a right-to-left fashion + — i.e., as "<bdi lang="he">ספרים בינלאומיים!</bdi>" + — while they would be stored in memory as + "<bdo dir="ltr" lang="he">ספרים בינלאומיים!</bdo>"</p> </section> </section>