Page MenuHomePhabricator

Ability to use language other than interface language for displayed TemplateData
Open, Needs TriagePublicFeature

Description

As a user of a multilingual wiki, I want pages to use particular language, which may be English or some other language, but want them not to use the UI language. For example, https://www.mediawiki.org/wiki/Template:Draft/de should be in German as much as possible, with appropriate fallback, but should not use other languages in the content area like UI language.

Acceptance criteria:

  • Create a lang attribute for the <templatedata> tag that specifies what language the rendered text should use. This applies to both the system messages like table headers, and data with InterfaceText data type.
  • Render the box in the language with the specified code. If the attribute is not present or is an invalid language code, continue to use UI language.

Event Timeline

Restricted Application added subscribers: Liuxinyu970226, Aklapper. · View Herald Transcript

I can come up with a patch if it’s OK.

I hope to resolve this some time (and I’m still happy to work on it), but don’t want to go ahead without an OK from the code owners.

Is there another use case other than on translatable pages?

It seems to me that in this case templatedata should instead by hooked into / made compatible with the translate extension rather than making this a feature that you set; template data already has support for multilingual template data, so you just need to display the correct language on translated pages which it doesn't appear to do.

I'd be really worried about having a new attribute that override's the user's preferred language in favour of whichever language the editor has decided to set for that particular page. They idea behind UI language is to respect that; unless, if course, they click on a translated page that displays rendered template data, then and only then should it be overwritten.

Nothing else comes to my mind apart from making eventual debugging easier. However, I don’t think creating an explicit connection between TemplateData and Translate is a good idea; Translate is already incredibly complex and hard to understand. Rather, this feature should depend on only MediaWiki core. I don’t really understand your concerns about editors forcing languages on others (yes, they can, but they can force overriding user preferences in a thousand of other ways, like when setting absolute widths for thumbnails instead of upright values, and yet we’re not full of complaints about these; editors can be expected to use common sense), but if you really don’t want to let users set arbitrary values, maybe a boolean parameter can allow choosing between UI language and page language. This allows for just the amount of customization we need and harder to exploit since only authorized users are allowed to change the page language.

Tacsipacsi changed the subtype of this task from "Task" to "Feature Request".Jun 23 2022, 8:51 PM