Page MenuHomePhabricator

Something better than Special:MyLanguage (broken Page previews broken, broken "what links here" broken, have to add prefix for translation, etc)
Open, Needs TriagePublic

Description

Special:MyLanguage as a solution for links is so painful. Page previews broken, "what links here" broken, have to add a giant prefix to each link to prepare a page for translation, and duplicate the page name, and no way to have the default behavior of just pasting the display title as the page link (terrible for translating those templates that you often find at the bottom of wikipedia-like pages that act as subject directories and really should automatically expand each link to the display title in the target language.)

You can write a template like mediawiki.org's Template:ll, but when I started that another contributor said "isn't it awkward to have to use a template for every link, everywhere" and all I could say is "yes. that's life."

What works great is language aware template transclusion. Could we make links work like that? Like, on the translated version of a page, each link is automatically replaced with a link to the version of the page in the same language, if one exists? For backwards compat this could be behind a checkbox or something.

Event Timeline

Aklapper renamed this task from Something better than Special:MyLanguage to Something better than Special:MyLanguage (broken Page previews broken, broken "what links here" broken, have to add prefix for translation, etc).Jan 3 2024, 5:54 AM

Had a possibly very good idea: have the main, untranslated URL for the page render in the user's UI language. Then all the links can just be normal unmodified links to the main page URL!

  • User-visible behavior is exactly the same as if every link was prefixed by Special:MyLanguage
  • No need to make any changes to links on the page to prepare for translation
  • For page previews and link titles...well with a bit of work, can probably make those use the translated version too?

I imagine this would have to be something you opt into with a PHP setting...

And how to link to the untranslated page?

In my mind, that's something you don't usually need to do, so it would be fine as a URL parameter or a special page or something similarly unintuitive. But is there something I'm not thinking of? Probably...

Or maybe it can render on Page/en or whatever the page language is. Ultimately meaning Page/en and Page get their rendering swapped