Page MenuHomePhabricator

lang and dir attributes must be applied to each editing box on "List of pages linked to this item"
Closed, ResolvedPublic

Description

Screenshot showing that the Hebrew word "helium" appears on the left-hand side instead of the right-hand side. This affects not just alignment, but also cursor movement, backspace button behavior etc.

When I'm editing links to other language versions, the box for editing the link target does not define its language and direction using HTML lang and dir attributes and therefore shows the Hebrew word on the wrong side. If I would be using the Hebrew interface, it would show English words on the wrong side.

The dir attribute is obviously essential: without proper direction definition, there will be an abundance of problems with editing left-to-right text in right-to-left environments and vice versa.

The lang attribute is essential, too, even though it is less obvious - it is used for proper font rendering in some languages, for speech recognition, for spell checking and for other features.

lang and dir attributes must also be applied to elements that just show words in foreign languages (<td class="wb-sitelinks-link"> etc.). And even more generally, lang and dir attributes must be applied whenever it is known that an element is written in a different language.

See http://www.w3.org/TR/html401/struct/dirlang.html for reference; it's a bit old, but completely relevant.


Version: unspecified
Severity: normal
Whiteboard: storypoints: 8
URL: http://wikidata-test-repo.wikimedia.de/wiki/Data:Q2?uselang=en

Attached:

editing-helium-nortl.png (660×1 px, 76 KB)

Details

Reference
bz39257

Event Timeline

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

Note that some times there will be "loanwords" used in a language and written in the same form that is used in the original language. That is word A comes from language A' and when this is written in a field for language B' it can still be in a form used at language A'. Such words can even be part of phrases that describes an entity. This can seriously mess up the layout.

I'm not sure if this have any easy quickfix, but perhaps it is enough to be able to somehow mark the text from another language. Now all kind of markup is stripped from the strings, but it is still possible to add rtl/ltr-markers as UTF8. What makes this a bit awkward is that such markup is invisible.

I propose that we go for a simple solution and only sets lang and dir and for now neglects any difficult loanwords.

Jeblad - you are right. That's what Bug 9360 is about. There must be a structured way to specify custom language for page content and title.

Until it's fixed, applying lang and dir to each item should be done. It will be not completely incorrect in the cases that you describe, but without it almost all other cases will be broken.

Verified in Wikidata demo time for sprint 15