W3C home > Mailing lists > Public > public-html-bugzilla@w3.org > October 2010

[Bug 10808] i18n comment 2 : new dir attribute value: auto, and a new attribute: autodirmethod

From: <bugzilla@jessica.w3.org>
Date: Thu, 21 Oct 2010 14:08:50 +0000
To: public-html-bugzilla@w3.org
Message-Id: <E1P8vp4-0000EE-7m@jessica.w3.org>
http://www.w3.org/Bugs/Public/show_bug.cgi?id=10808

--- Comment #20 from Aharon Lanin <aharon.lists.lanin@gmail.com> 2010-10-21 14:08:48 UTC ---
(In reply to comment #14)
> If there are
> other use cases to consider here, such as the ones in comment 12, then please
> describe them, ideally with URLs pointing to real Web pages showing those use
> cases, so that I can study them. It's impossible to evaluate proposals without
> concrete use cases.

Use case 1: movie listings web page with user's choice of interface language.
Here is an actual Hebrew page with English movie titles:

http://www.google.com/movies?q=ifc+center&hl=iw&near=new+york

As you can see, some of the movie titles are garbled, e.g. "(Heartbreaker
(L'arnacoeur". That's because they are not labeled with dir=ltr. Of course,
when displaying the data for movies playing in Tel Aviv, many of them are
likely to be rtl instead, so this is a classic case for dir=auto. Other items
appearing on the page whose directionality can differ from that of the page are
the user's query, theatre names, theatre addresses, and site names. The
direction has been set correctly on the addresses, or they would all be
garbled. (That was done on the server side, using an estimation algorithm
implemented there.)

In all these cases, the elements that need dir=auto are inline, although for
the movie title it could go either on the <a> immediately around the title or
on the <div> around the <a>. Doing it on the <div> would make the movie title
start-aligned, and would break the clean layout of the page, so it's better
done on the inline <a>.


Use case 2: geo-coded wikipedia content in a map application with user's choice
of interface language. Here is an actual Hebrew page with an English wikipedia
entry:

http://maps.google.com/maps?f=q&source=s_q&hl=iw&geocode=&q=Mountain+View,+CA&sll=37.0625,-95.677068&sspn=36.915634,55.458984&ie=UTF8&hq=&ll=37.410528,-122.083855&spn=0.145078,0.216637&z=12&iwloc=lyrftr:org.wikipedia.he,13560065738740292074,37.363609,-122.082138&lci=org.wikipedia.he

The article text is displayed properly because it has been declared dir=ltr.
This was done on a div, and as a result, the article is left-aligned. In this
case, this is highly desirable: right-aligned multi-line English text is hard
to read. Thus, we sometimes do want dir=auto on a block element.

Use case 3: chat. The names of the chatters may be LTR or RTL, and the text
that  any particular user enters may be LTR or RTL, and in fact can change
depending on the people with whom he or she is chatting - even in the middle of
the conversation.

Each user name and utterance needs dir=auto, or it risks being displayed
garbled, e.g. "(Little Boy (Blue" instead of "Little Boy (Blue)".

A <textarea dir=auto> would be a simple way to collect the user's next
utterance.

But how would we display the chat that has already happened? There are many
ways to tackle this, but one design would be to have each entry of the chat in
a div whose direction fits the utterance, so the utterance is not only
displayed correctly, but is aligned to its own start direction, and is thus
easier to read. Furthermore, we might want to have the user's name (and perhaps
a picture) on the start side of that utterance - independently of the direction
of the user's name or of the UI as a whole. Please see attached chat.html to
see what that would actually look like.

Of course, unlike the attached html, we want to use dir=auto, not dir=ltr and
dir=rtl, since we don't know the direction of the user's name or utterance. The
HTML template might look something like this:

  <div class="chatentry" dir="auto">
    <img src="{chatter_pic_url}" />
    <span dir="auto" class="chattername">{chatter_name}</span>:
    <span class="utterance">{utterance}</span>
  </div>

Please note that the chatentry div's direction is set according to the
utterance, which is in a child element, but is unaffected by the chatter name's
direction, which is also in a child element, since that element has dir=auto of
its own.

-- 
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 Thursday, 21 October 2010 14:08:51 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:01:32 UTC