Page MenuHomePhabricator

Use Special:MyLanguage redirect for preload param in EditPage and ApiVisualEditorEdit
Closed, ResolvedPublic3 Estimated Story Points

Description

Background

It is possible to create pages and sections with preloaded text, using the preload URL parameter.

When a translateable page is the target of the preload param, it would be helpful to fall back to an appropriate language if a particular translation does not exist. For an example of where we might want to do this, see T296272#7619882.

We can do this using Special:MyLanguage, which redirects to a translated version of a given page in the user's language, using the fallback chain if a translation is missing in that language.

Acceptance criteria

When the target of the preload param is a translateable page for a language that does not yet have a translation, the page for the next available language in the fallback chain is preloaded instead. This should work for:

Notes

Requirements for testing:

Example steps for testing (non-VisualEditor):

  • Create a page e.g. TranslateablePage, and translate it into a language that other languages fall back to (helpful tutorial here), e.g. TranlsateablePage/fr
  • Create a new page with this page preloaded, with the language set to one that falls back to the translated language, e.g. NewPage?action=edit&preload=Special:MyLanguage/TranslateablePage&uselang=frp (frp falls back to fr)
  • Expected: The editor for NewPage is pre-filled with the contents of TranslateablePage/fr (assuming no tranlsation exists for frp)

Example steps for testing (VisualEditor):

Event Timeline

Change 755335 had a related patch set uploaded (by Tchanders; author: Nikerabbit):

[mediawiki/core@master] Support Special:MyLanguage for preload param

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

Change 755926 had a related patch set uploaded (by Tchanders; author: Tchanders):

[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Support Special:MyLanguage for preload param

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

How can we go about testing that this works on Wikimedia? I haven't worked with unsupported languages before.

@wikitrent I've added some testing steps - FAO @STran too

Moving to stalled while we concentrate on the testwiki deployment blockers. Will pick this up again after those.

ARamirez_WMF renamed this task from Use Special:MyLanguage redirect for preload param in EditPage and ApiVisualEditorEdit [M] to Use Special:MyLanguage redirect for preload param in EditPage and ApiVisualEditorEdit .Feb 8 2022, 5:01 PM
ARamirez_WMF set the point value for this task to 3.

Change 755335 merged by jenkins-bot:

[mediawiki/core@master] EditPage: Support Special:MyLanguage for preload param

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

Change 755926 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] ApiVisualEditor: Support Special:MyLanguage for preload param

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

imaigwilo subscribed.

Verified the translation happens per acceptance criteria notes using my local box
And thanks @Tran for assisting with the testing.