Page MenuHomePhabricator

Make insertion of Special:MyLanguage optional
Open, MediumPublicFeature

Description

Preparing a page for translation prefixes all internal wiki links with Special:MyLaguage, but this breaks Page Previews. This is the subject of T145541, open since 2016 and currently marked Low, so little prospect of resolution in a useful timeframe..

This is a significant problem for the Restarters Wiki (wiki.restarters.net). Promoting electrical and electronic repair and assuming the minimum of prior knowledge, Page Previews are an important aid to comprehesion and accessibility, in particular where they provide pop-up glossary definitions.

As a work-around, we have manually removed all MyLanguage templates and written an API script to list links to be manually internationalised in translated pages. The wiki currently runs to 178k words so this is a significant task, but just about manageable given the fairly low rate of translation.

The problem would be significantly reduced if it were possible to turn off the automatic insertion of Special:MyLanguage templates by Prepare for Translation.

There should be an option to allow this specific aspect of Prepare Page for Traslation to be disabled.

Event Timeline

Aklapper changed the subtype of this task from "Task" to "Feature Request".Jul 4 2023, 3:54 PM

This sounds like a feature request with one single use case (which requires having one specific extension installed)?

I believe characterising this as a feature request with one single use case does not do it justice. Page Previews are completely broken when the Translate extension is installed. For example, hover over any link in mediawiki.org/wiki and you get a useless Spcial:MyLanguage pop-up. Compare this with Wikipedia where you generally get a highly informative page preview.

Both translation and page previews are essential features for us and a temporary work-around (assuming the root cause shows no sign of being fixed) would be the ability to optionally disable the insertion of Special:MyLanguage prefixes to internal links on preparation of a page for translation.

Nikerabbit triaged this task as Medium priority.Jul 6 2023, 10:04 AM
Nikerabbit moved this task from Backlog to page migration on the MediaWiki-extensions-Translate board.

Pleriche: Thanks for the elaboration! That helped a lot to understand the impact.

@Pleriche, well you can always get better results by preparing a page for translation manually. The special page is rather a convenience feature...

@Base: Well you could, but you need an excellent understanding of how the Translation Unit tags work and the ability to insert them without error. But I assume you might also have to manually hack the database to mark the page as available for translation - definitely not a good idea.

Equally, with less effort and less liklihood of error, you can manually take out the Special:Mylanguage prefixes after preparing a page for translation. But if some eager beaver has already started translating the page into a language you don't understand before you notice, this gets harder.

@Base: Well you could, but you need an excellent understanding of how the Translation Unit tags work and the ability to insert them without error.

Actually, with a little practice, I think one’s able to prepare a page at a much higher quality than with the special page. In my experience, the special page more often gets it wrong than right.

But I assume you might also have to manually hack the database to mark the page as available for translation - definitely not a good idea.

No, manual hacking of the database is not necessary. All this special page does is inserting the markup and saving the page – you could do this using action=edit as well. The “Mark this page for translation” link appears because of the <translate> tags, not because of using the special page. Inserting the tags manually also makes the link appear.

@Tacsipacsi : Thank you, that's interesting to know - it would have taken me for ever to ascertain that with any certainty from the doumentation. But what about the /en versions of pages that appear - do they serve any useful purpose?

If it were my day job I might follow your lead but for occasional use the special page is going to be less error prone. The only problem I've foud with it (apart from Special:MyLanguage) is that it tends to insert unwanted blank lines. But they're easily enough weeded out.

@Tacsipacsi : Thank you, that's interesting to know - it would have taken me for ever to ascertain that with any certainty from the doumentation. But what about the /en versions of pages that appear - do they serve any useful purpose?

This question is out of scope here – let’s continue on your mediawiki.org user talk page.