Break up $wgDummyLanguageCodes
authorThis, that and the other <at.light@live.com.au>
Thu, 12 Jan 2017 14:17:41 +0000 (01:17 +1100)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 8 Mar 2017 20:11:30 +0000 (12:11 -0800)
commit48ab87d0a37da80c2e2ae3a20f645548d2a787f9
tree125ff6755926595df59643b4b2228dfab55eeeba
parentc62e736f183abc62f9b80fcf2703f1a9d8bd379a
Break up $wgDummyLanguageCodes

$wgDummyLanguageCodes is a set and mapping of different language codes:

* Renamed language codes: ['als' => 'gsw', 'bat-smg' => 'sgs',
                           'be-xold' => 'be-tarask', 'fiu-vro' => 'vro',
                           'roa-rup' => 'rup', 'zh-classical' => 'lzh',
                           'zh-min-nan' => 'nan', 'zh-yue' => 'yue'].
  The old language codes are deprecated because they are invalid but
  should be supported for compatibility reasons for a while.
* Language codes of macro languages, which get mapped to the main
  language: ['bh' => 'bho', 'no' => 'nb'].
* Language variants which get mapped to main language:
  ['simple' => 'en'].
* Internal language codes of the private-use-area which get mapped to
  itself: ['qqq' => 'qqq', 'qqx' => 'qqx']

This is a very strange conglomeration which should get differentiated,
and were split up in the following ways:

* Renamed language codes are available from
  LanguageCode::getDeprecatedCodeMapping().
* Language codes of macro languages and the variants that are mapped to
  the main language are available as $wgExtraLanguageCodes and are set
  in DefaultSettings.php.
* Internal language codes are set in $wgDummyLanguageCodes in Setup.php.

Change-Id: If73c74ee87d8235381449cab7dcd9f46b0f23590
autoload.php
includes/DefaultSettings.php
includes/Setup.php
languages/LanguageCode.php [new file with mode: 0644]
tests/phpunit/languages/LanguageCodeTest.php [new file with mode: 0644]