Map dummy language codes in sites
authorAdrian Heine <adrian.heine@wikimedia.de>
Tue, 7 Jun 2016 13:15:36 +0000 (15:15 +0200)
committerDaniel Kinzler <daniel.kinzler@wikimedia.de>
Tue, 7 Jun 2016 13:43:48 +0000 (13:43 +0000)
commit1c1c74adef8a2f5597472e8c049010ff4d42ff64
treef0eedf9ac53c9457188c5731ad68916d5060078e
parent045ca4ca47eb3b9120599d6964b33c15bd96b6e7
Map dummy language codes in sites

The script that populates the sites table assumes that the
subdomain is the content language code. This is not true for
all wikis. This patch introduces a mapping to fix this issue
on the fly, based on $wgDummyLanguageCodes.

This is driven by the need to avoid "bad" language codes when
creating wikidata items from the client, when "linking" two
pages on different wikis. When we do this, we use the language
code from the sites table for the labels of the new item.
We would like to forbid "dummy" languages in labels and
descriptions, for consistency.

Change-Id: I6452761e14d9902bb069e32d0f499bc39e680453
includes/ServiceWiring.php
includes/site/DBSiteStore.php
includes/site/FileBasedSiteLookup.php
tests/phpunit/includes/site/DBSiteStoreTest.php
tests/phpunit/includes/site/FileBasedSiteLookupTest.php