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

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

Aharon Lanin <aharon.lists.lanin@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |

--- Comment #11 from Aharon Lanin <aharon.lists.lanin@gmail.com> 2010-11-16 12:00:05 UTC ---
Sorry, but it still needs tweaking. I would like the paragraph beginning with
"A string provided by a script" to read more like this:

--- PROPOSED TEXT ---
Text provided by a script (e.g. the argument to window.alert()) is expected to
be displayed according to the rules of the Unicode bidirectional algorithm for
splitting text into paragraphs and determining the overall direction of each
paragraph. For instance, U+000A LINE FEED (LF) characters are expected to
separate between paragraph, and the overall direction of a paragraph starting
with a right-to-left character is expected to be right-to-left."
--- END OF PROPOSED TEXT ---

Also, the code example needs to be drastically simplified. It must not deal
with inserting data of one direction into a message of a different direction.
This is an "advanced" topic that comes up less frequently than using a simple
message with no admixtures of data. Unfortunately, inserting data correctly
often requires wrapping the data being inserted into the message in LRE|RLE and
PDF, followed by an LRM or RLM. Furthermore, due to the imperfections of the
direction estimation algorithm mandated by Unicode, one must not start a
paragraph with such data, since it will force the paragraph into the wrong
direction (unless, as you point out, one uses LRM or RLM first). The code in
your example does not deal properly with either of these requirements and would
output a garbled message. To avoid having to give an extended lesson on on the
right way to do bidi, while still giving a correct example, we can simply stay
away from the "advanced" topic and stick to a simple message with no inserted
data, e.g.:

--- PROPOSED TEXT ---
For example, alert('\u05DC\u05DE\u05D3 HTML \u05D4\u05D9\u05D5\u05DD!') should
always result in a message reading "<span dir=rtl>&#1500;&#1502;&#1491; HTML
&#1492;&#1497;&#1493;&#1501;!</span>" (not "&#1500;&#1502;&#1491; HTML
&#1492;&#1497;&#1493;&#1501;!"), regardless of the language of the user agent
UI or the direction of the page or any of its elements.

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

(When I indicated "<span dir=rtl>" above I meant that you need to actually put
that into the HTML source of the spec.)

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

Received on Tuesday, 16 November 2010 12:00:10 UTC