Page MenuHomePhabricator

Adapt wikilambda-zobject-title better for RTL user interface
Closed, ResolvedPublicBUG REPORT

Description

The message wikilambda-zobject-title may have an issue with RTL languages. It is $1 ($2) and it's optional. $2 is always a ZID, and a Latin letter with some numbers is always an LTR string. $1 is the function name. It's possible that a function name will be defined as an LTR string, even in an RTL language. In such a case, the ZID will be shown before the function name and not after it.

The possible solutions are:

  1. In RTL languages, do translate the message and add an RLM character before the opening parentheses. Something similar was in the translation to Punjabi (pnb, Arabic-script), but with the ALM character and not RLM. This will work, but it is not a great solution, because it has to be done for each RTL language separately.
  2. Change the message to $1 (<span dir="ltr">$2</span>). This will bidi-isolate the ZID, and ensure correct logical display. This is a more robust solution, but it has a couple of issues:
    1. It would also require changing ->text to ->parse; perhaps it's possible, but it may have implications that I'm not noticing because I'm not familiar with the rest of WikiLambda code.
    2. In languages that do want to translate it (e.g. Chinese, which uses different parentheses) will also have to copy this HTML code.
  3. Put the ZID <span dir="ltr"> in the code and not in the message. This is probably the most robust solution, but if this is chosen, it should probably be done by someone who is familiar with WikiLambda code, because it probably makes sense to do it as a function that returns a ZID wrapped in this, and also used in some other places.
  4. Make the message non-optional and add the word "id" before the ZID: $1 (id: $2). If the word is translated using RTL letters, it will ensure isolation.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 940204 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikiLambda@master] i18n: Wrap ZID handed to wikilambda-zobject-title in a span for RTL users

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

Change 940204 merged by jenkins-bot:

[mediawiki/extensions/WikiLambda@master] i18n: Wrap ZID handed Linker in a span for RTL users

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