Page MenuHomePhabricator

Add CodeMirror to Special:Translate
Open, Needs TriagePublic

Description

Requested on Discord.

The editors are dynamically created on Special:Translate.

Related Objects

Event Timeline

Do you have a link for the conversation? I'd like to better understand where this would be helpfu.

Do you have a link for the conversation? I'd like to better understand where this would be helpfu.

https://discord.com/channels/221049808784326656/1327412705266499674/1497747856914907330

I think the fix I made at https://translatewiki.net/?diff=14129468 is a good example of where CodeMirror in Special:Translate would have been quite handy. I ended up editing the message page directly just so I could get the syntax highlighting and verify my changes were correct.

For the record, myself and likely Bhsd as well are happy to do the work here. The only caveat to be aware of is that under the normal conditions of "CodeMirror outside of action=edit", we don't get a toolbar that allows users to toggle it on and off. They instead can do so through [[Special:Preferences#mw-prefsection-editing-syntax-highlighting]]. This matches the behaviour in many other places in both in MW Core and various extensions. CodeMirror users generally want it everywhere there is editable wikitext or code.

CodeMirror users generally want it everywhere there is editable wikitext or code.

I don’t want it everywhere. CodeMirror is resource-heavy and less compatible (e.g. I just tested that it doesn’t update the primary selection on Linux), so I only turn it on when I need to, for example to understand complex wikitext.

Translate could provide a toolbar/button (e.g. in the bottom left of the edit box, where there are already buttons), couldn’t it?

Screenshot 2026-06-16 at 08-36-08 Translate Recent additions - translatewiki.net.png (849×150 px, 13 KB)

(Probably the button could have an icon, similarly to the Paste source text button and similarly to the action=edit toolbar button, but I didn’t want to play with that for the sake of the mockup.)

Translate could provide a toolbar/button (e.g. in the bottom left of the edit box, where there are already buttons), couldn’t it?

Screenshot 2026-06-16 at 08-36-08 Translate Recent additions - translatewiki.net.png (849×150 px, 13 KB)

(Probably the button could have an icon, similarly to the Paste source text button and similarly to the action=edit toolbar button, but I didn’t want to play with that for the sake of the mockup.)

That sounds great! This should be easy to implement.