Page MenuHomePhabricator

VisualEditor: RTL typing is not working in Urdu
Open, Needs TriagePublic

Description

When using visual editor in Urdu Wikipedia, the RTL typing method is not working. Instead, it types LTR which is wrong for Urdu language. The direction of editor is correct but letters go in right side instead of left side, For example: if we write ویکی (wiki) it will be typed as یکیو (ikiw), reversed. However, it works properly in Persian and Arabic, and hence we found no issue there.

You can experiment this error through this link

Event Timeline

I can reproduce this issue even when typing Latin characters with input methods disabled!

It looks like every time you type a character, the cursor is placed before that character rather than after it.

I also noticed a similar issue with inserting paragraphs – the cursor remains in the previous paragraph, rather than moving to the next one.

In this video, I have VE opened in debug mode (so that I can look at the internal model and be less confused about how things should actually look like in RTL). I type 'wiki' with input methods disabled, then press Enter to add a paragraph and Ctrl+M to enable the input method, and type 'wiki' with it enabled. In both cases the input is reversed.

I also got a few errors like below coming from this script: https://meta.wikimedia.org/wiki/User:ערן/spellchecker.js (which is apparently loaded by a gadget or site JS) when closing the pulsating blue dots on the Link and Cite tools:

index.php?title=User%3Aערן%2Fspellchecker.js&action=raw&ctype=text/javascript:244 Error in Gadget-Rechtschreibpruefung.js:documentUpdate
index.php?title=User%3Aערן%2Fspellchecker.js&action=raw&ctype=text/javascript:245 TypeError: model.getSelection(...).getRange is not a function
    at index.php?title=User%3Aערן%2Fspellchecker.js&action=raw&ctype=text/javascript:226
    at VeDmSurface.oo.EventEmitter.emit (oojs.jquery.js?b1631:824)
    at VeDmSurface.ve.dm.Surface.onDocumentTransact (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?ed7f8:1083)
    at VeDmDocument.oo.EventEmitter.emit (oojs.jquery.js?b1631:824)
    at VeDmDocument.ve.dm.Document.commit (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Document.js?ef557:341)
    at VeDmSurface.ve.dm.Surface.changeInternal (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?ed7f8:941)
    at VeDmSurface.ve.dm.Surface.popStaging (/w/extensions/VisualEditor/lib/ve/src/dm/ve.dm.Surface.js?ed7f8:363)
    at VeUiCiteFromIdInspector.<anonymous> (/w/extensions/Citoid/modules/ve.ui.CiteFromIdInspector.js?af96a:485)
    at oojs-ui-windows.js?2f6db:769
    at OO.ui.Process.execute (oojs-ui-windows.js?2f6db:804)

I can reproduce it, too. I suspect that this makes VE completely unusable in Urdu.

I'm wondering why is it a problem in Urdu, but not in Hebrew or Arabic.

The problem is caused by some site scripts, since it doesn't occur with &safemode=1.

Restricted Application added a subscriber: Huji. · View Herald TranscriptAug 9 2023, 2:59 PM