(Siebrand, I am unsure if this will arrive at mediawiki-i18n, feel free to forward it you consider it interesting to them).
OK, I've written a few lines of Python [1] which actually helped me answer my questions. Sorry to bother.
And the answers are yes, yes, no, but close, and i hope so.
There are a small number of wikis which use a different language code than their site code is, namely:
crh -> crh-latn als -> gsw be-x-old -> be-tarask roa-rup -> rup simple -> en
But, at the same time, the given *site* codes exist as *language* codes as well, i.e. the languages/messages files exist for them, but they just fallback to the given language code (i.e. MessagesAls.php just names gsw as a fallback).
I would not be surprised if each of these five examples would have an anecdote to explain why they are the way they are :)
Thanks, Denny
P.S.: There is one thing I do not understand though. According to https://simple.wikipedia.org/w/api.php?action=query&meta=siteinfo the language of simple.wp is "en", but MessagesSimple.php seems to be taken into account (instead of "edit" it has "change" in the UI, one of only two changes in MessagesSimple to MessagesEn). So it seems that the language is "simple" -- why does it say "en" in the siteinfo?
[1] available here: http://pastebin.com/JpApSmNX
2012/5/9 Siebrand Mazeland s.mazeland@xs4all.nl
Forwarded. Please cc Denny, as he is not on this list.
Begin doorgestuurd bericht:
*Van:* Denny Vrandečić denny.vrandecic@wikimedia.de *Datum:* 9 mei 2012 01:36:01 GMT+02:00 *Aan:* MediaWiki Tech list wikitech-l@lists.wikimedia.org *Onderwerp:* *[Wikitech-l] Language codes vs site codes* *Antwoord aan:* Wikimedia developers wikitech-l@lists.wikimedia.org
Hi,
Wikimedia projects like Wikipedia exist for a large number of languages (>280, wow). Let us call them the sites. They are identified by the site code used in the subdomain and in language and interwiki links, e.g. "en" for en.wikipedia.org, i.e. the English Wikipedia.
MediaWiki has a number of interface languages. These are selected through the preferences. They also have short language codes that identify them and which are used, e.g. in the localization of the code. "en" is used for English.
My four questions:
- are the language codes a proper superset of the site codes?
- if the code is the same in both cases, does it always refer to the same
language?
- does the Wikimedia project identified by a specific site code also always
use the same language code as its default interface language?
- are the answers to the previous three questions accidental or by design,
i.e. can we expect that this will stay like this in the future?
I hope that the answers are yes,yes,yes,yes :)
Sorry for the nitpicking questions, I hope someone knows the answers.
Cheers, Denny
-- Project director Wikidata Wikimedia Deutschland e.V. | Obentrautstr. 2 | 10963 Berlin Tel. +49-30-219 158 26-0 | http://wikimedia.de