You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
(i18n) Relationship between dir and the content #1494
Specify that consumers of strings should use heuristics, preferably based on the Unicode Standard first-strong algorithm, to detect the base direction of a string except where metadata is provided. more (emphasis is mine, I.H.)
This requirement seems to be contradicted by the spec. At the moment, the EPUB 3.3 spec says
Inherent directionality specified using [Unicode] takes precedence over this attribute.
The way I can read this is that the first-strong algorithm in Unicode wins over the value of the dir attribute.
That would certainly be wrong; the Publication Manifest example shows the situation where the value of dir must be followed in contrast to the first strong algorithm.
Maybe that was not the intention in the EPUB spec, but then it needs clarification.
This goes back to the original 3.0 specification. I don't have any insight into the specifics of it (probably came from the EGLS group?), but I'm not sure I read it the same way.
What it seems to be saying to me is that if there is strong directionality in the text, that has precedence -- just because dir says the text is ltr, for example, doesn't mean that setting overrides an rtl run within it. I don't expect the intent was that if you find any directionality at the text level that supersedes the attribute.
But, in any case, it could certainly stand for clarification.
"If an element mixes text runs with different directionalities, the [Unicode] directionality of a text run takes precedence over the dir attribute where they differ."
I think the dir attribute should take precedence.
As someone who uses RTL language (Hebrew) every day, I think the unicode
directionality is not always good enough.
On Sun, Jan 31, 2021 at 2:46 PM Matt Garrish ***@***.***> wrote:
What about wording more along these lines:
"If an element mixes text runs with different directionalities, the
[Unicode] directionality of a text run takes precedence over the dir
attribute where they differ."
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1494 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAB43QED62S6VIZR2DQHFBTS4VGKLANCNFSM4WZEKDJQ>
.
What it seems to be saying to me is that if there is strong directionality in the text, that has precedence -- just because dir says the text is ltr, for example, doesn't mean that setting overrides an rtl run within it. I don't expect the intent was that if you find any directionality at the text level that supersedes the attribute.
The example in the pub manifest is exactly the case where this would go wrong. The first strong directionally would be given by the letter 'H' and you need the extra metadata to overwrite this to get the Hebrew text right.
The spec is not clear, but the requirement is simple IMHO. The dir attribute should be used to specify what Unicode (UAX #9 - Unicode Bidirectional Algorithm)) calls the paragraph direction (also called "base direction"), no less no more. The base direction does not override the inherent direction of text runs within the element but affects how those runs are ordered relatively to each other for display.
For determining the base direction of strings or inline insertions, the i18n WG recommends that first-strong heuristics be used by default to detect base direction, but those heuristics fail if a string begins with a character which has an opposite direction to the string as a whole (such as a book title in Arabic that begins with 'HTML'). For those cases there needs to be a way to explicitly override the heuristics, which is what the dir attribute does.
The dir attribute is also useful for setting a direction that will be inherited through a whole document or sections of a document, eg. at the top of an HTML file.
Setting a dir attribute is an explicit choice, and must therefore always override the application of heuristics unless the auto value is set.
Dave Cramer: i18n self test says what is in the ticket
… spec specifies that directionality in unicode takes precedence
… over the dir attribute
… Matt says if there's strong directionality in the text, that takes precedence
… dir doesn't control everything
… see r12a's comments
… what Richard says there makes sense
… we need to remove that line in the spec stating that unicode directionality takes precedence
… it would conflict with the guidance from Richard
… address the issue by having Matt removing that bit and clarifying the text
… the relationship between the string and the dir attribute
… any opposition?
Ben Schroeter: The change being that dir wins?
Dave Cramer: Removing the line that says strings can override dir
Brady Duga: I don't think anyone knows what it means
… dir sets the base direction
… but it has nothing to do with unicode for instance
… the unicode API does that
… we're reaching
… we should just say "this is what dir does"
Dave Cramer: This is a lesson, if you get that deep into it, it's confusing
Proposed resolution: Fix 1494 by removing the untrue statement about the relationship between dir and the underlying text(Wendy Reid)
Resolution #2: Fix 1494 by removing the untrue statement about the relationship between dir and the underlying text
Activity
OriKuttner commentedon Jan 30, 2021
iherman commentedon Jan 31, 2021
Here is the full section on the
dirattribute in the 3.3 version:Where do you see the "except where metadata is provided" note?
(I would be happy to be proven wrong!)
It is the same as in the 3.2 version, i.e., this is not a matter of editorial issue when 3.3 was created out of the 3.2 specs.
mattgarrish commentedon Jan 31, 2021
This goes back to the original 3.0 specification. I don't have any insight into the specifics of it (probably came from the EGLS group?), but I'm not sure I read it the same way.
What it seems to be saying to me is that if there is strong directionality in the text, that has precedence -- just because
dirsays the text is ltr, for example, doesn't mean that setting overrides an rtl run within it. I don't expect the intent was that if you find any directionality at the text level that supersedes the attribute.But, in any case, it could certainly stand for clarification.
mattgarrish commentedon Jan 31, 2021
What about wording more along these lines:
"If an element mixes text runs with different directionalities, the [Unicode] directionality of a text run takes precedence over the
dirattribute where they differ."OriKuttner commentedon Jan 31, 2021
iherman commentedon Jan 31, 2021
I agree. I also think that this is the advice given by the i18n experts at W3C.
Switching on the I18n label to request an input from the i18n people
iherman commentedon Jan 31, 2021
The example in the pub manifest is exactly the case where this would go wrong. The first strong directionally would be given by the letter 'H' and you need the extra metadata to overwrite this to get the Hebrew text right.
murata2makoto commentedon Jan 31, 2021
I am afraid that I have no ideas. The recommendations from the EGLS subgroup does not mention the dir attribute.
matial commentedon Feb 2, 2021
The spec is not clear, but the requirement is simple IMHO. The dir attribute should be used to specify what Unicode (UAX #9 - Unicode Bidirectional Algorithm)) calls the paragraph direction (also called "base direction"), no less no more. The base direction does not override the inherent direction of text runs within the element but affects how those runs are ordered relatively to each other for display.
r12a commentedon Feb 3, 2021
For determining the base direction of strings or inline insertions, the i18n WG recommends that first-strong heuristics be used by default to detect base direction, but those heuristics fail if a string begins with a character which has an opposite direction to the string as a whole (such as a book title in Arabic that begins with 'HTML'). For those cases there needs to be a way to explicitly override the heuristics, which is what the
dirattribute does.The
dirattribute is also useful for setting a direction that will be inherited through a whole document or sections of a document, eg. at the top of an HTML file.Setting a
dirattribute is an explicit choice, and must therefore always override the application of heuristics unless theautovalue is set.hth
iherman commentedon Feb 9, 2021
The issue was discussed in a meeting on 2021-02-04
List of resolutions:
dirand the underlying textView the transcript
2. Relationship between dir and the content
See github issue #1494.
Dave Cramer: i18n self test says what is in the ticket
… spec specifies that directionality in unicode takes precedence
… over the
dirattribute… Matt says if there's strong directionality in the text, that takes precedence
…
dirdoesn't control everything… see r12a's comments
… what Richard says there makes sense
… we need to remove that line in the spec stating that unicode directionality takes precedence
… it would conflict with the guidance from Richard
… address the issue by having Matt removing that bit and clarifying the text
… the relationship between the string and the dir attribute
… any opposition?
Ben Schroeter: The change being that
dirwins?Dave Cramer: Removing the line that says strings can override
dirBrady Duga: I don't think anyone knows what it means
…
dirsets the base direction… but it has nothing to do with unicode for instance
… the unicode API does that
… we're reaching
… we should just say "this is what
dirdoes"Dave Cramer: This is a lesson, if you get that deep into it, it's confusing