Page MenuHomePhabricator

Scanning QR code on RTL wiki results in odd username label
Open, LowestPublic

Description

When scanning the QR code on a right-to-left script wiki, the label is incorrect.

Here we see the proper label for enwiki, but incorrect labels for hewiki, fawiki, and arwiki. This screen shot is from Google Authenticator on iOS. Could someone with Google Authenticator installed on an Android device test this for the aforementioned wikis?

Event Timeline

dpatrick updated the task description. (Show Details)

I just did it on fawiki, but didn't see much point trying ar and he (but can if deemed necessary)

It looks broken, but not quite as much as it is on iOS

fawiki, fa lang

fawiki, en lang

Both of these seem to result in the same format on Google Authenticator (I think.. will confirm)

Is the problem the atypical thing that happens when we have ltr and rtl in the same string? I guess we should try with a fully RTL "username" and checking if MW/Google Authenticator handles it correctly.. Might need to ask someone that speaks with those languages and is used to dealing with it.. Just for ease of caret placement and alike

I guess, partially MW is to "blame" and there's probably some blame to pass onto Google... We can file issue(s) at the repo for the app at least at https://github.com/google/google-authenticator

Might be worth testing Authy and the LastPass Authenticator too

So LastPass and authy won't let you take screenshots...

LastPass it splits the farsi to the top of block, and displays the username correctly with brackets. So I guess it gets around it by using the key seperate....

Authy displays it the same as it does on wiki...

So, I don't think Android is actually broken, but iOS is more so?

Ping @Amire80 as I know he like issues like this...

Reedy lowered the priority of this task from Medium to Lowest.Nov 7 2016, 8:23 PM

Dropped priority right down for this.. Still interested in trying to fix it, if someone i18n minded can help, but for WMF purposes, setting a global site prefix alleviates this issue as is

Since we are using "wikimedia" as prefix, It really doesn't matter but if you want to solve it at any time, check if the wiki is rtl and then add ‏ before and add ‎ after the prefix name and don't escape it. Then we are good to go.

Ladsgroup moved this task from Incoming to Monitor on the User-Ladsgroup board.

Since we are using "wikimedia" as prefix, It really doesn't matter but if you want to solve it at any time, check if the wiki is rtl and then add ‏ before and add ‎ after the prefix name and don't escape it. Then we are good to go.

That was my plan (to leave it just as Wikimedia)... But @Tgr on T147901

This should be a message key, not a plain string. Not all languages use the Latin alphabet; even those that do might adapt the spelling of proper nouns.

Does it happen in the Google Authenticator app? Can we try reporting it Upstream? It should be fairly easy to set automatic direction on usernames.

And if it can't be fixed upstream, can we send a different string to it? Perhaps we could add some Unicode control characters to fix it. It would be hacky.

In any case, we are far from showing it totally correctly in MediaWiki itself, which is why I always suggest not to use parentheses in names.

(Also, a good modern implementation of the Unicode bidirectional algorithm is supposed to fix the parentheses problem. It is already done well in Gecko, but not in Webkit.)

Amire80 renamed this task from Scanning QR code on RTL wiki results in odd label to Scanning QR code on RTL wiki results in odd username label.Feb 3 2018, 11:42 AM

There should probably be a space after the colon, that's optional but allowed, and it's both more stylistically correct and probably helps the bidi algorithm figure out where the word boundaries are.

I created a really simple test repo at https://github.com/reedy/qrtest to generate the QR code on a page that can be easily manipulated, and displayed onscreen

<div class="mw-display-qrcode" data-mw-qrcode-url="otpauth://totp/Wikimedia:USERNAME?secret=K5UWW2LNMVSGSYI&issuer=Wikimedia" style='width: 256px; height: 256px;' / >

(zomg, the secret is Wikimedia)

The Wikimedia:USERNAME is the part to play about with as to what the app decides to display in it