Page MenuHomePhabricator

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:

notif-username-rtl.png (295×516 px, 21 KB)

Note the broken parentheses because of mixed directionality.

Event Timeline

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.

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

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

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

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}

Screen Shot 2016-03-25 at 1.47.19 PM.png (420×607 px, 56 KB)

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 :

Screen Shot 2016-03-28 at 11.05.53 AM.png (308×561 px, 47 KB)

Screen Shot 2016-03-28 at 11.15.13 AM.png (350×556 px, 56 KB)

Screen Shot 2016-03-28 at 11.15.01 AM.png (297×585 px, 53 KB)