Page MenuHomePhabricator

Put line numbers in left side also in RTL wikis
Closed, ResolvedPublic

Description

Recently line numbers are enabled for displaying site wide .css and .js files, a nice tweak, but even the fact the line numbers feature was developed over the years now that it is enabled for broader use the fact the actual numbers in RTL wikis are in right side feels very unnatural as having line numbers on right makes tracking of actual lines to line numbers difficult. If we consider the line numbers a part of user interface not content (which I think they are in gray zone) we should turn the numeral they use from 123456789 to ۱۲۳۴۵۶۷۸۹ for Persian wiki for example which I believe is in a wrong direction.

Example link:
https://fa.wikipedia.org/wiki/مدیاویکی:Common.js?uselang=fa

Screenshot trying to explain the line to line number tracking issue, that isn't an issue in LTR that there is no wide blank space between the code and line numbers.

image.png (914×1 px, 315 KB)

Event Timeline

Restricted Application added subscribers: Huji, Aklapper. · View Herald Transcript

Change 655629 had a related patch set uploaded (by Ebrahim; owner: Ebrahim):
[mediawiki/extensions/SyntaxHighlight_GeSHi@master] i18n: put line numbers on the left side also in RTL

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

Line numbers are in the left side while editing CSS/JS codes, I think a consistent behavior is expected here.

image.png (712×892 px, 154 KB)

Thanks for this. The extension is actually supposed to support <syntaxhighlight dir=rtl>.... In this case the line numbers would be on the right, so I've amended your patch to position line numbers based on code block directionality (which defaults to LTR on all wikis).

Change 655629 merged by jenkins-bot:
[mediawiki/extensions/SyntaxHighlight_GeSHi@master] Line numbers use mw-content-ltr/rtl direction

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