Page MenuHomePhabricator

Enable the "content language variant" functionality on the preference to the multilingual sites such as the Commons and Meta-Wiki
Open, Needs TriagePublic

Description

Currently, the translation module of the MediaWiki set the universal Chinese translation function and offered the conversion system to the zh-HANT, zh-HANS, zh-HANT-tw, zh-HANS-cn, zh-HANS-sg, zh-HANT-mo, zh-HANS-my and zh-HANT-hk. However, when a user set the preferred language variant (e.g. zh-HANT-tw), the translation page of zh still remains unconverted version (zh page).

Screenshot_2019-05-31 Commons OTRS zh - Wikimedia Commons.png (536×2 px, 149 KB)

The default page is unconverted (不轉換, 不转换, as the zh page) and cannot redirect to the preferred local variant page a user sets on the preferences.

螢幕快照 2019-05-31 05.23.42.png (746×1 px, 264 KB)

I must click the menu to select the local variant page manually.

Other multilingual sites have the same problems (e.g. Meta).

Update:

I think that I found the problem.

In Chinese Wikipedia, the zh-xx conversion redirect is controlled by the "content language variant" in the preference:

圖片.png (928×2 px, 191 KB)

However, the function on the Commons, Meta and other multilingual sites are not available.

圖片.png (840×2 px, 156 KB)

So, I want to request that the "content language variant" function should be deployed to the multilingual sites.

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
RazeSoldier subscribed.

In fact, "language variants" page tab provide by UniversalLanguageSelector extension.

This looks like a feature request.

Sorry, "language variants" page tab build in MW core :) But we can consider adding a redirect feature to UniversalLanguageSelector.

Related task: T56942, T106131, T50292 (Err, these requests have not handled for a looooong time.)

I think that I found the problem.

In Chinese Wikipedia, the zh-xx conversion redirect is controlled by the "content language variant" in the preference:

圖片.png (928×2 px, 191 KB)

However, the function on the Commons, Meta and other multilingual sites are not available.

So, I want to request that the "content language variant" function should be deployed to the multilingual sites.

圖片.png (840×2 px, 156 KB)

Taiwania_Justo renamed this task from Cannot automatically redirect to the preferred zh-xx page and still remain unconverted version as default to Cannot automatically redirect to the preferred language variant and still remain unconverted version as default on the mulitlanguage sites.Jun 17 2019, 2:37 AM
Taiwania_Justo renamed this task from Cannot automatically redirect to the preferred language variant and still remain unconverted version as default on the mulitlanguage sites to Cannot automatically redirect to the preferred language variant and still remain unconverted version as default on the multilingual sites such as the Commons and Meta.
Taiwania_Justo updated the task description. (Show Details)
Taiwania_Justo renamed this task from Cannot automatically redirect to the preferred language variant and still remain unconverted version as default on the multilingual sites such as the Commons and Meta to Deploy the "content language variant" function on the preference to the multilingual sites such as the Commons and Meta-Wiki.Jun 17 2019, 6:05 AM
Taiwania_Justo renamed this task from Deploy the "content language variant" function on the preference to the multilingual sites such as the Commons and Meta-Wiki to Enable the "content language variant" function on the preference to the multilingual sites such as the Commons and Meta-Wiki.Jun 17 2019, 6:14 AM

I imagine that part of the problem is that the "content language" of Commons is English, not Chinese. However, "content language" is something of a misnomer on multilingual wikis, as the language of the content is mostly determined by your interface language rather than the wiki's content language on multilingual wikis. Perhaps LanguageConverter could be modified to accommodate this. @liangent - Any thoughts on the feasibility of this?

Nikerabbit subscribed.

Language converter is already working based on the page content language. See for example https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/zh&variant=zh-hans and https://www.mediawiki.org/w/index.php?title=Help:Extension:Translate/zh&variant=zh-hant where you can see the language converter working, and the variant selection interface.

This task is asking to have the variant setting appear in Special:Preferences under language selection (see screenshots in the description). I believe it's currently only shown if wiki content language is set to zh.

@Nikerabbit Perhaps it should be shown if the user interface language has variants? There should be no problem w/ enabling language converter on a page-by-page basis; we already parse language converter markup uniformly on all wikis. I don't have any conceptual problem with this, we'll need to take some care to make sure the outcome is as expected, though.

(Aka, we may also need to enable language converter on those wikis, even though the per-page language settings would leave it effectively disabled on most articles.)

Yeah that would make sense to me. The language converter itself seems to work already on all wikis. Just wondering who could take a lead on this – it's not in Language's plan currently.

Assuming this is doable on multilingual wikis, it would be really nice if the Language variant option in the preferences only showed up if you set your language to one that has variants. That might require a bit of extra hackery though.

Change 743658 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Provide an input field of language variants for multi-language wikis

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

I noticed that my patch is fit for this task.

Ok, now we have two Patch demo wikis, the second one is configured to be a multi-language wiki.

https://patchdemo.wmflabs.org/wikis/40e0abbfad/wiki/Special:Preferences

It seems that once a variant is selected and saved in the preferences, you cannot deselect it or switch to no conversion as the content language variant.

https://patchdemo.wmflabs.org/wikis/40e0abbfad/wiki/Special:Preferences

It seems that once a variant is selected and saved in the preferences, you cannot deselect it or switch to no conversion as the content language variant.

Fixed, it wouldn't update to Patch demo though...

Let's discuss whether it's necessary or not to make it be able to be a global preference. Now GlobalPreferences extension doesn't support the multiselect field to be global, but a useless checkbox would be displayed still.

I was thinking about separated fields, as there seems to have separated preference values stored?

Preferences_values_language_variant.png (451×250 px, 25 KB)

I was thinking about separated fields, as there seems to have separated preference values stored?

That would be too long in the ui, and most users don't need to set so many language's variant. That's why they are set to be api preference initially.

Yeah. It would be too long to list all of them.

Test wiki on Patch demo by Func86 using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/40e0abbfad/w/

Oh, Patch demo doesn't support GlobalPreferences...

Change 752016 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/GlobalPreferences@master] Make global exceptions work for HTMLMultiSelectField

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

Change 752025 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/GlobalPreferences@master] Allow LanguageVariantSelectField to be global

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

Change 751833 had a related patch set uploaded (by Func; author: Func):

[mediawiki/extensions/GlobalPreferences@master] Make local exceptions work for HTMLMultiSelectField

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

Change 751837 had a related patch set uploaded (by Func; author: Func):

[mediawiki/core@master] Make logic of fetching array-type preferences more general

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

Test wiki on Patch demo by Func86 using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/42df7ddd4a/w/

Test wiki on Patch demo by Func86 using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/d1f768c5ac/w/

Test wiki created on Patch demo by JSherman (WMF) using patch(es) linked to this task:
https://patchdemo.wmflabs.org/wikis/492ce68649/w

Change 751837 merged by jenkins-bot:

[mediawiki/core@master] DefaultPreferencesFactory: Fetch array-type preferences in a general way

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

Test wiki on Patch demo by Func86 using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/77ce61cef3/w/

Test wiki on Patch demo by Func86 using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/455063e13c/w/

Test wiki on Patch demo by JSherman (WMF) using patch(es) linked to this task was deleted:

https://patchdemo.wmflabs.org/wikis/492ce68649/w/

If possible, maybe if the user’s set language has a corresponding variant-something, set it if possible and expose it in preferences?

Winston_Sung renamed this task from Enable the "content language variant" function on the preference to the multilingual sites such as the Commons and Meta-Wiki to Enable the "content language variant" functionality on the preference to the multilingual sites such as the Commons and Meta-Wiki.Jan 27 2024, 6:06 AM