Page MenuHomePhabricator

suggested text direction tweaks for RTL languages in CodeMirror keyboard shortcuts list
Closed, ResolvedPublicBUG REPORT

Description

There is an RTL issue with the list of keyboard shortcuts in CodeMirror. The direction of the complete shortcut should be forced to ltr. Currently, in right to left languages, it appears as I + CTRL for italic, for example, which is hard to read. The button names are written in English, so the whole thing should appear from left to right in all languages. Technically, adding dir="ltr" to all the <kbd class="cm-mw-keymap-key"> should be enough to resolve this.

The above suggested fix will also fix the appearance of key labels like [, which are flipped in RTL languages. This flipping is misleading—it will expand the code instead of folding it, and vice versa.

Theoretically, this may work incorrectly for some other keys or if some of the key names are ever translated into RLT languages. Practically, however, none of the current keyboard shortcuts will be incorrectly affected, and translating key names into any RTL language is unnecessary. So in practice, the above solution is enough.

Event Timeline

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

Change #1228178 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] codemirror.keymap.less: ensure LTR for keyboard shortcuts

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

Change #1228178 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] codemirror.keymap.less: ensure LTR for keyboard shortcuts

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

Bhsd moved this task from Bugs to Done on the MediaWiki-extensions-CodeMirror board.