There is apparent inconsistency in the language codes returned by SiteLookup and other services, and our new SiteMatrixLookup implementation creates outputs which don't match the legacy service, but it's currently unknown which of the results is "correct". We will try to choose the best value, once we understand how to construct it.
Here are the results seen today on a few special wikis:
| dbname | $wgLanguageCode | legacy SiteLookup language | new SiteLookup language | SiteMatrix API special lang |
|---|---|---|---|---|
| metawiki | en | en | meta | meta |
| mediawikiwiki | en | en | mediawiki | mediawiki |
| aewikimedia | en | en | en | en |
| arbcom_nlwiki | nl | en | nl | nl |
Acceptance criteria
- SiteMatrixLookup language should match $wgLanguageCode for each wiki.
While we clean this up, there are some other gaps that can be filled:
- language code is not exported by SiteExporter
- language code is unnecessarily validated in Site.php, invoking an ad-hoc service which makes the class untestable with unit tests. Validation should be the responsibility of an input layer such as SiteImporter.