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: