Split some Language methods to LanguageNameUtils
authorAryeh Gregor <ayg@aryeh.name>
Thu, 2 May 2019 14:23:42 +0000 (17:23 +0300)
committerAryeh Gregor <ayg@aryeh.name>
Fri, 23 Aug 2019 09:52:35 +0000 (12:52 +0300)
commit2e52f48c2ed8dcf480843e2186f685a86810e2ac
tree5041b0f343810bede7e3ea341d003b86aaa90345
parente4ce770cbd8938aff9bc4a008815f7cf380fbfd8
Split some Language methods to LanguageNameUtils

These are static methods that have to do with processing language names
and codes. I didn't include fallback behavior, because that would mean a
circular dependency with LocalisationCache.

In the new class, I renamed AS_AUTONYMS to AUTONYMS, and added a class
constant DEFINED for 'mw' to match the existing SUPPORTED and ALL. I
also renamed fetchLanguageName(s) to getLanguageName(s).

There is 100% test coverage for the code in the new class.

Change-Id: I245ae94bfc1f62b6af75ea57525139adf2539fe6
16 files changed:
RELEASE-NOTES-1.34
autoload.php
includes/MediaWikiServices.php
includes/ServiceWiring.php
includes/cache/localisation/LocalisationCache.php
includes/language/LanguageCode.php
includes/language/LanguageNameUtils.php [new file with mode: 0644]
languages/Language.php
languages/data/Names.php
maintenance/rebuildLocalisationCache.php
tests/common/TestsAutoLoader.php
tests/phpunit/includes/api/ApiQuerySiteinfoTest.php
tests/phpunit/includes/cache/LocalisationCacheTest.php
tests/phpunit/languages/LanguageTest.php
tests/phpunit/unit/includes/language/LanguageNameUtilsTest.php [new file with mode: 0644]
tests/phpunit/unit/includes/language/LanguageNameUtilsTestTrait.php [new file with mode: 0644]