Page MenuHomePhabricator

Description input field on items list is LTR in an RTL environment
Closed, ResolvedPublic


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.)

Version: unspecified
Severity: normal
Whiteboard: storypoints: 5


wikidata-repo-description-rtl.png (430×746 px, 39 KB)



Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:53 AM
bzimport set Reference to bz40247.
bzimport added a subscriber: Unknown Object (MLST).

I thinkdir="auto" only works for presentation, so it will be no easy solution here.

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."

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.

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;


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.

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.

There's no reason to even consider dir="auto" when the language is known.

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.

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?

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.

Appears to work correctly in the current test site.