User names and other content language-y things in notifications should be bidi-isolated
Closed, ResolvedPublic

Description

The following is what happens when I have a thank notification from User:Jdforrester (WMF) on commonswiki (an English-speaking wiki) and view it on hewiki:

Note the broken parentheses because of mixed directionality.

Catrope created this task.Feb 19 2016, 1:05 AM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 19 2016, 1:05 AM

Change 272934 had a related patch set uploaded (by Catrope):
Bidi-isolate secondary link labels and notification bodies

https://gerrit.wikimedia.org/r/272934

Change 272935 had a related patch set uploaded (by Catrope):
Wrap $1 (user name) in {{bidi:}} in notification-header-* messages.

https://gerrit.wikimedia.org/r/272935

https://gerrit.wikimedia.org/r/272934 takes care of bidi-isolation in the interface. We still have to do bidi-isolation of user names where they appear in notification text though, using {{bidi:$1}} in the i18n message. This can easily be automated and done for all languages. I submitted https://gerrit.wikimedia.org/r/272935 as an example against the Thanks extension, and I'll wait for feedback from the localization people before I build more patches like that against other extensions.

Catrope added a comment.EditedFeb 24 2016, 5:45 AM

To test 272934:

  • Create a user called Bob (WMF)
  • While logged in as Bob (WMF), edit User talk:Alice (replace Alice with the user name you normally use)
    • In this edit, create a new section called Foo bar!, and write Bar baz! in it
  • Log in as Alice (WMF)
  • View your notifications with your interface language set to Hebrew (either change your language in your preferences, or append ?uselang=he to the URL)
  • You should see the following differences before and after applying 272934
    • The secondary link for the user looks like (Bob (WMF before and Bob (WMF) after
    • The notification body looks like !Bar baz before and Bar baz!
    • The section name as quoted in the notification header looks like "!Foo bar". It should look like "Foo bar!" but I haven't put up a patch that fixes that yet (awaiting feedback on 272935)
  • Now view this notification from a different wiki using cross-wiki notifications. The secondary link for the user is now in the dotdotdot menu, but it should behave the same as it does on the first wiki ((Bob (WMF before and Bob (WMF) after).

To test 272935:

  • While logged in as Bob (WMF), thank Alice for an edit
  • While logged in as Alice, view the thank notification with your language set to Hebrew
    • The user name as quoted in the notification header looks like (Bob (WMF before and Bob (WMF) after
    • (Note that there's also a secondary link with the user name; that's covered by 272934)

Change 272935 abandoned by Catrope:
Wrap $1 (user name) in {{bidi:}} in notification-header-* messages.

Reason:
Abandoning this because doing this in code means I have to do it in a different repo (Echo). Thanks for the suggestion!

https://gerrit.wikimedia.org/r/272935

Restricted Application added a project: I18n. · View Herald TranscriptFeb 24 2016, 9:20 PM

Change 273113 had a related patch set uploaded (by Catrope):
Bidi-embed formatter user names (the $1 parameter) in notification messages

https://gerrit.wikimedia.org/r/273113

To test 272935:

These same things are now fixed by 273113 instead.

I still need to write a patch to bidi-isolate section names, and look at what else might need it.

Change 273113 merged by jenkins-bot:
Bidi-embed formatter user names (the $1 parameter) in notification messages

https://gerrit.wikimedia.org/r/273113

Change 273968 had a related patch set uploaded (by Catrope):
Bidi-embed user names and page names in secondary links

https://gerrit.wikimedia.org/r/273968

Change 272934 merged by jenkins-bot:
Bidi-isolate notification bodies

https://gerrit.wikimedia.org/r/272934

Change 273968 merged by jenkins-bot:
Bidi-embed user names and page names in secondary links

https://gerrit.wikimedia.org/r/273968

Catrope renamed this task from User names in notifications should be bidi-isolated to User names and other content language-y things in notifications should be bidi-isolated.Mar 10 2016, 12:23 AM

Change 276388 had a related patch set uploaded (by Mooeypoo):
Bidi isolate content items in notification header text

https://gerrit.wikimedia.org/r/276388

Catrope reassigned this task from Catrope to Mooeypoo.Mar 10 2016, 12:23 AM

Change 276388 merged by jenkins-bot:
Bidi isolate content items in notification header text

https://gerrit.wikimedia.org/r/276388

Change 276693 had a related patch set uploaded (by Catrope):
Bidi-embed topic titles in notifications

https://gerrit.wikimedia.org/r/276693

Change 276694 had a related patch set uploaded (by Catrope):
Bidi-embed course names in notifications

https://gerrit.wikimedia.org/r/276694

Change 276695 had a related patch set uploaded (by Catrope):
Bidi-embed instance names in notifications

https://gerrit.wikimedia.org/r/276695

Catrope claimed this task.Mar 11 2016, 3:52 AM

I went through notifications in extensions (other than Echo) and added bidi-embedding where needed. In most cases it wasn't needed because generic functions from EchoEventPresentationModel were being used.

Change 276693 merged by jenkins-bot:
Bidi-embed topic titles in notifications

https://gerrit.wikimedia.org/r/276693

Change 276694 merged by jenkins-bot:
Bidi-embed course names in notifications

https://gerrit.wikimedia.org/r/276694

Change 276695 merged by jenkins-bot:
Bidi-embed instance names in notifications

https://gerrit.wikimedia.org/r/276695

  1. Checked for usernames used previously for T106741: Bidi-isolate username fields in Flow boards

ET((V
ET(III)
ET\99\

  1. Checked the testing scenarios from @Catrope comments{F3716480}

Note: additional testing needs to be done for cross-wiki notifications (temporarily not displayed in betalabs)

Adding screenshots for cross-wiki notifications- username Bob (QRT) is displayed correctly in RTL context :

jmatazzoni closed this task as Resolved.Mar 29 2016, 11:40 PM