Page MenuHomePhabricator

Languages not supported in MediaWiki should not fall back to English
Open, MediumPublicFeature

Description

The WikimediaIncubator extension makes use of the PageContentLanguage hook, for setting the page language based on the test wiki, so e.g. [[incubator:Wp/khw/%D8%AF%D8%B9%D8%A7]] is parsed in Khowar (khw), with lang="khw" and dir="rtl" attributes on the content div. Thanks to this, Narayam and WebFonts also know which language it is.

That is all perfect as long as the language is defined. Because the hook passes it through a language object, unknown languages fall back to English (wgContLang). So on [[incubator:Wp/saz/ꢓꢾꢥꢶꢥ꣄]] (Sourashtra), it is currently lang="en".

Two possible solution I can come up with:

Relatively simple solution: add a possibility to force literal language codes to avoid fallback to English, by adding a parameter to the hook and make some changes to wfGetLangObj() etc.

Ideal solution: make it in one way or another possible to (easily) add languages (stub MessagesXx files and/or wgExtraLanguageNames) to Incubator that are not yet in MW core but have translatewiki.net support. This could also make LocalisationUpdate work for these languages so users benefit early of their translations.

PS: this bug report belongs to several products/components (but I have to take one so I took WikimediaIncubator)


Version: unspecified
Severity: enhancement

See also:

Details

Reference
bz33028
TitleReferenceAuthorSource BranchDest Branch
output-sql.js: Remove comparisons that aren't stored in the DBrepos/mediawiki/services/ipoid!164tchandersmain-Iee930142cc9e85e4502ce8e7003b3277ddf9879cmain
Implemented gitlab-pipeline GitLab delegation job in Zuulrepos/releng/gitlab-dev!1dduvallreview/zuul-to-gitlab-delegationmain
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:05 AM
bzimport set Reference to bz33028.
bzimport added a subscriber: Unknown Object (MLST).

And the current supposed workflow is that translatewiki.net languages with most used messages translated are committed, and then can/should be MFT to 1.18wmf1, but in the case of Sourasthra (and other languages too), the translations are not sufficient to be committed (yet).

We could use r105922 so it can be committed only for use on Incubator, but I suppose it would require a lot of work maintaining and merging to the live site.

Reword bug summary (testing RSS anyways).

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 12:24 PM
Aklapper removed a subscriber: wikibugs-l-list.
jhsoby added a subscriber: Amire80.

10 years later …

It seems that the main part of this is solved, namely using the correct language for the content language even if that language isn't otherwise supported in MediaWiki at all.

However, one important thing in order to give proper support for otherwise unsupported languages is a way to set the language direction for RTL languages. If you look at Hawrami (language code hac), which is a currently-unsupported language, you can see that they "solve" this by adding HTML tags with the right classes and dir attributes: https://incubator.wikimedia.org/wiki/Wp/hac
I'm thinking a way to solve this would be to add languages that have some Incubator activity to language-data; that should then cascade down to Incubator through the usual methods. @Amire80, do you have any insight/suggestions? (see next comment)

Language-data is not (yet) integrated with MediaWiki core.

Ah, sorry, I was confused then. Thanks for clearing that up.