[Bug 10827] i18n comment 23 : script dialog text direction

http://www.w3.org/Bugs/Public/show_bug.cgi?id=10827

--- Comment #14 from Aharon Lanin <aharon.lists.lanin@gmail.com> 2010-12-01 12:35:34 UTC ---
(In reply to comment #12)
> Could you elaborate on what problem this proposal is intended to solve?

1. The spec currently says, basically, that script dialog text is to be treated
as a set of Unicode Bidi Algorithm paragraphs. The Unicode Bidi Algorithm does
specify rules - specifically P2 and P3 - for determining the overall direction
of each paragraph. However, it explicitly allows a "higher level protocol" to
override P2 and P3 and give the paragraphs whatever direction it wants. In
HTML, the exception is actually the rule: the direction of text content is
determined by mark-up, which is a higher-level protocol. All current browser
versions use the same approach for dialog text and apply to it some higher
level protocol, e.g. the direction of the root element or the user agent's UI
direction. I do not think anyone has claimed that by doing so, user agents
violate the Unicode Bidi Algorithm. Thus, I believe that to require the
behavior we want, the HTML spec must give some clear indication that the
direction of script dialog text paragraphs must be determined without applying
a higher-level protocol. The spec's current requirement does not seem to do so,
except in the examples. It mentions the division of the text into paragraphs,
but not the directions these paragraphs are to take.

2. [Editorial] It is better to stick to the term "text" instead of switching to
the term "string" for no apparent reason ("A string provided by a script").

3. [Editorial] The repetition of the term "bidirectional algorithm" should be
avoided if possible.

> > The code in your example does not deal properly with either of these
> > requirements and would output a garbled message.
> 
> Right, that's the point of the example. :-)

Are you saying that you were trying to illustrate what can go wrong? This was
not clear to me. I do not think that the spec should give buggy code as an
example, especially without stating extremely clearly that it is buggy and
without giving a correct version. If you want to illustrate the necessity of
using LRM or RLM to enforce a direction, I would recommend giving the correct
version instead, e.g.:

--- PROPOSED TEXT ---
When necessary, authors can enforce a particular direction for a given
paragraph by starting it with the Unicode U+200E LEFT-TO-RIGHT MARK or U+200F
RIGHT-TO-LEFT MARK character.

Consider, for example, the following more complex script:

var s;
if (s = prompt('What is your name?')) {
  alert('\u200E' + s + '! Ok, Fred, ' + s + ', and Wilma will get the car.');
}

The script starts the alert with a LEFT-TO-RIGHT MARK because the alert is in
English overall and must be treated as left-to-right to be displayed correctly.
Without the LEFT-TO-RIGHT MARK, when the user enters a right-to-left string
like "&#1604;&#1575; &#1571;&#1601;&#1607;&#1605;" in response to the prompt,
the alert would start with right-to-left text and would be displayed as
right-to-left, unintelligibly.
--- END OF PROPOSED TEXT ---

-- 
Configure bugmail: http://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You reported the bug.

Received on Wednesday, 1 December 2010 12:35:36 UTC