Page MenuHomePhabricator

The lang and directionality attributes of the source selector is not updated when language changed
Open, LowPublic

Description

Steps to reproduce:

  1. Choose Hebrew as source language, and select some title.
  2. Change the source language to English
  3. Type Curiosity (rover) in the source title field. Observe its rendering

The RTL directionality is not updated along with language change.

<a class="cx-selected-source-page__link" lang="he" dir="rtl" href="https://en.wikipedia.org/wiki/Curiosity_(rover)" title="Curiosity (rover)" target="_blank">Curiosity (rover)</a>

Event Timeline

santhosh created this task.Oct 8 2018, 5:13 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 8 2018, 5:13 AM
Restricted Application added a project: I18n. · View Herald TranscriptOct 17 2018, 7:53 PM

I'm not sure I understand the steps to reproduce. Point 3 as it's written now requires reopening the selector, so everything is rebuilt anyway. It's possible that I misunderstand it.

However, I do see an issue here. Try the following:

  1. Select Hebrew as the source language.
  2. Type "מדונה". (This is "Madonna". In Hebrew it's the article about the singer, and it doesn't have parentheses in the title.)
  3. Change the source language to English. The title auto-changes to "Madonna (entertainer)".

Observed:

  1. lang="he" dir="rtl" on the <a> element with the title.
  2. In Chrome, the parentheses appear broken, like "(Madonna (entertainer". (This doesn't happen in Firefox, because it implements the part of the Unicode bidi algorithm that auto-fixes the parentheses.)

Expected:

  1. lang="en" dir="ltr" on the <a> element with the title.
  2. Parentheses must appear correctly in all browsers.
Amire80 moved this task from Needs Triage to Bugs on the ContentTranslation board.Nov 30 2018, 9:04 AM
Arrbee moved this task from Bugs to Check & Move on the ContentTranslation board.Sep 30 2019, 7:46 AM
Pginer-WMF triaged this task as Low priority.Mon, Nov 11, 9:21 AM
Arrbee added a subscriber: Arrbee.Mon, Nov 11, 9:21 AM

@santhosh is this ticket still relevant?

lang and dir attributes of source page title are still not updated and wrong when switching source language.

However, Chrome (haven't checked Chromium) seems to have implemented part of bidi algorithm which auto-fixes parentheses. @Amire80 do you happen to know if this is true?
This now ends up being only semantically wrong, without affecting the visuals.