Last modified: 2012-12-13 11:20:57 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T42247, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 40247 - Description input field on items list is LTR in an RTL environment
Description input field on items list is LTR in an RTL environment
Status: VERIFIED FIXED
Product: MediaWiki extensions
Classification: Unclassified
WikidataRepo (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Wikidata bugs
storypoints: 5
: i18n
Depends on:
Blocks: rtl-wikidata
  Show dependency treegraph
 
Reported: 2012-09-14 04:53 UTC by Amir E. Aharoni
Modified: 2012-12-13 11:20 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
a screenshot showing the problem (39.73 KB, image/png)
2012-09-14 04:53 UTC, Amir E. Aharoni
Details

Description Amir E. Aharoni 2012-09-14 04:53:17 UTC
Created attachment 11109 [details]
a screenshot showing the problem

The description input field has LTR directionality even when my language is Hebrew. It is correctly assigned lang="he", but it must also have explicit dir="rtl" accordingly. (And dir="ltr" for ltr languages.)
Comment 1 jeblad 2012-09-19 16:11:38 UTC
I thinkdir="auto" only works for presentation, so it will be no easy solution here.
Comment 2 jeblad 2012-09-19 16:14:32 UTC
This should work according to W3C.

"Use dir="auto" on forms and inserted text in order to automatically detect the direction of content supplied at run-time. Consider using the dirname attribute on forms to send information about direction in addition to the usual form data."

http://www.w3.org/International/tutorials/new-bidi-xhtml/qa-html-dir
Comment 3 Amir E. Aharoni 2012-09-19 16:24:41 UTC
As far as I understand, this description is supposed to be written in each language, so the correct language and directionality must be assigned. If lang="he" can be assigned to that element, assigning the correct dir is very easy using the Language::getDir() method.
Comment 4 jeblad 2012-09-19 16:37:59 UTC
Seems like we hit some nasty styling that interferes with language direction
set on each input element.

.sitedir-ltr textarea, .sitedir-ltr input {
    direction: ltr;
}
Comment 5 Amir E. Aharoni 2012-09-19 16:40:14 UTC
Yes, it defines the default, and it makes sense, at least in the current way MediaWiki is built. But it's easy to override it.
Comment 6 jeblad 2012-09-19 16:59:28 UTC
Yes. The reason why I posted it here is that we made some very rudimentary checking about how to fix this, and use of dir="auto" failed, but with this styling our test results could be wrong.
Comment 7 Amir E. Aharoni 2012-09-19 17:05:05 UTC
There's no reason to even consider dir="auto" when the language is known.
Comment 8 jeblad 2012-09-19 21:16:37 UTC
Even if we could assume a label/description to always be according to the given language, which I think we can't, we should still consider dir="auto" because its implications as a more lightweight solution. If not we must most likely either change language caching or do our own caching.

The language cache is purged when it reaches 10 entries, while we can have up to several hundred languages on one page. The problem comes from the sitelink table on the item page.

Anyhow, I think it is sufficient for now. Thanks for the additional points.
Comment 9 Amir E. Aharoni 2012-09-20 01:36:44 UTC
dir="auto" doesn't make a lot of sense on an input box. It's for static text.

If we can't assume that the description is in the given language, then why is the lang attribute assigned to it? Is a description written in every language or only in one language?
Comment 10 denny vrandecic 2012-09-20 09:30:11 UTC
So for descriptions and labels input boxes we set the directionality attributes accordingly to the language. Avoid "auto" as it does not seem to be there yet.
Comment 11 Daniel Kinzler 2012-09-20 09:30:46 UTC
For reference: http://www.w3.org/International/questions/qa-bidi-css-markup
Comment 12 Amir E. Aharoni 2012-10-13 12:26:33 UTC
Appears to work correctly in the current test site.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links