The property/tag would need to be added (automatically) going forward.
Also, a maintenance script to retrospectively (rather than waiting for translation updates to potentially propagate it) add the property/tag would be very very useful...
The property/tag would need to be added (automatically) going forward.
Also, a maintenance script to retrospectively (rather than waiting for translation updates to potentially propagate it) add the property/tag would be very very useful...
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Add page property for translation pages | mediawiki/extensions/Translate | master | +4 -5 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Open | None | T311409 Wikibase needs special handling for translatable pages | |||
Open | None | T304939 Translation pages cluttering various page listings | |||
Resolved | abi_ | T230456 Don't list translations as orphaned pages | |||
Open | Feature | hueitan | T216368 Allow to hide translations on special page "WhatLinksHere" | ||
Open | Feature | None | T181339 Add a "Hide translated pages" for Special:AllPages | ||
Open | Feature | None | T304977 Option to remove translation pages from search results | ||
Open | None | T304978 Remove translation pages from UnconnectedPages and related API | |||
Open | None | T351374 Improve Translatable Pages based on research input | |||
Resolved | Feature | Reedy | T299308 Add Hide translations to Special:PrefixIndex | ||
Resolved | Reedy | T347429 Store whether a page is a "translation" (sub) page in the database to allow varying SQL queries |
@Nikerabbit Any hints where this could/should be added?
And preference whether we use MW core's page_props or Translate's revtag?
My preference would be page_props unless DBAs start screaming at me and suggesting a better solution. Just needs a small addition to PageTranslation\Hooks::renderTagPage near the end of the function. Something like
if ( !TranslatablePage::isSourcePage( $title ) ) { $wikitextParser->getOutput()->setPageProperty( 'translation-page' ); }
I would presume, unless we started adding the tag to every page (with a true or false), that this shouldn’t be an issue. And as such, using the existence of the row for the page being enough…
For a magnitude, Metawiki has 10k translatable pages. If we assume each translatable page has 100 translation pages (which would be awesome), we are still talking about a million extra rows. Other wikis are smaller.
Change 961970 had a related patch set uploaded (by Reedy; author: Reedy):
[mediawiki/extensions/Translate@master] Add page property for translation pages
One condition that we may have to consider is what happens when a page marked from translation is removed from translation. Should its translations not be considered translations anymore? If so, should we remove these properties from the page?
The property will be removed automatically by next re-parse of the page. There is no need to explicitly remove page props, nor any easy way for us to retain them.
As far as I know we call Title::invalidateCache for all translation pages. I'm not sure if that is enough, though.
Change 961970 merged by jenkins-bot:
[mediawiki/extensions/Translate@master] Add page property for translation pages
Running refresh-translatable-pages.php should populate the translate-is-translation property in page_props table.
Tracking this work in the parent task. See: https://phabricator.wikimedia.org/T299308#9333468
Marking this as done.