Page MenuHomePhabricator

RTL title ending in a neutral-direction character displays incorrectly when viewing in an LTR language
Closed, ResolvedPublic

Description

Author: mt.cutler

Description:
When viewing a page like [[ar:عمان (مدينة)]]‏‎ (ending in a bracket, a neutral character) with an LTR langauge chosen as the interface language, the final character of the title is displayed to the right of the word, as if it is at the start, when it should obviously be displayed at the left (at the end). It displays correctly if the interface language is RTL.

This bug seems to have started when a recent interface change was made, when the layout started to depend on the selected interface language rather than the language of the wiki.
Basically, before a recent change, the layout of RTL wikis was always the same no matter what the interface language was, and was a mirror of the interface on LTR wikis. Recently, that was changed, so that the menu is on the left side if you select an LTR interface language. For some reason, this also changed the side the title is displayed on, and also introduced this bug.

As this bug also appears on he.wiki ([[he:מכבי תל אביב (כדורגל)]]‏‎), I’d guess this is a general bug on RTL wikis, rather than one specific wiki.

I’ve confirmed that this bug occurs on both Chrome and Firefox, and on both vector and monobook skins.


Version: unspecified
Severity: normal
URL: http://ar.wikipedia.org/wiki/%D8%B9%D9%85%D8%A7%D9%86_%28%D9%85%D8%AF%D9%8A%D9%86%D8%A9%29
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=49093

Details

Reference
bz32403
TitleReferenceAuthorSource BranchDest Branch
[builds-cli]: drop direct k8s api calls and use builds-api exclusivelyrepos/cloud/toolforge/builds-cli!6raymond-ndibefull_frontend_refactormain
Customize query in GitLab

Event Timeline

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

I was aware of this when making the change so that the direction depends on the user interface language (bug 6100). I didn't know how the direction of the title should be decided, so I left it as is.

We cannot use the page content language because then "MediaWiki:Message/he" would be RTL, but the title obviously is LTR (except when the namespace is localised) regardless of the content.

We have two alternatives:

  • use dir="auto" (only on Chrome so far) which would automatically put the title at the right place
  • use a hack by using both RLM and LRM, as I did for special page lists (Language::specialList())

It works (or rather breaks) the other way, too:
https://en.wikipedia.org/wiki/Therapy%3F?uselang=he

The quickest way to fix it would probably be to add dir="auto" to the titles.
It's dirty, it won't solve all the cases and it will only work in the newest
browsers - it probably only works in Chrome currently, but will soon work in
Firefox, and it will not affect other browser badly. But it will be better than the current situation.

I'm not keen on using RLM and LRM at all. It's too complicated and won't solve all the problems.

<h1 id="firstHeading" class="firstHeading">
<span dir="auto"><?php $this->html( 'title' ) ?></span>
</h1>

doesn't prevent wrong brackets in

http://de.wikipedia.org/w/index.php?title=Burg_Stahleck_%28Bacharach%29&action=history&uselang=ar
or
http://ar.wikipedia.org/w/index.php?title=%D8%B9%D9%85%D8%A7%D9%86%20%28%D9%85%D8%AF%D9%8A%D9%86%D8%A9%29&action=history&uselang=en

Only the wiki-title itself should included in a separate span.

A separate span with an ID would be also useful to access the DISPLAYTITLE formated title with JavaScript in preview and view.

Well, it's easy to fix it in the history title, but it will have to be fixed in many other places, so i'm thinking about a more generic way to do it.

It's similar to bug 35085 in this regard.

Yes, thats right. But when we have a universal solution the workaround from r105854/r105870 should be removed again.

  • Bug 36803 has been marked as a duplicate of this bug. ***

gangleri wrote:

please see a solution at bug 36803#0

it should be posible to solve this in css

gangleri wrote:

(In reply to comment #9)

please see a solution at bug 36803#0

it should be posible to solve this in css

At bug 36803#0 have been severe syntax errors; they should have been corrected at
http://en.wikipedia.org/?oldid=492347485#bugzilla:36803 .

Jdlrobson subscribed.

I can't replicate this with the URL in the description so can I assuime this was fixed upstream @Amire80?

If not, could the description be updated with what still needs to happen?

Jdlrobson changed the task status from Open to Stalled.Jan 15 2021, 11:43 PM

I can't replicate this with the URL in the description so can I assuime this was fixed upstream @Amire80?

If not, could the description be updated with what still needs to happen?

Closing this Phabricator task as no further information has been provided. Assuming this is resolved. If this still happens, please set the status of this task back to "Open" via the Add Action...Change Status dropdown. Thanks!

Yes, one can say that it was fixed upstream: The specification of the behavior of parentheses in the Unicode bidirectional algorithm was changed to work in a more sensible way, and this specification change was implemented in Gecko and WebKit, so now parentheses usually work without extra manual markup.