转到文件
WaitSpring 31ac6d3840
Merge branch 'REL1_41' of https://git.qiuwen.net.cn/Mirror/mediawiki-extensions-cldr
2024-02-20 12:07:11 +08:00
.phan Remove unused CldrCurrencies/CldrCurrency 2022-03-01 13:06:50 +00:00
CldrCurrency Update to cldr 43 2023-05-08 08:19:28 +00:00
CldrNames Merge branch 'REL1_41' of https://git.qiuwen.net.cn/Mirror/mediawiki-extensions-cldr 2024-02-20 12:07:11 +08:00
CldrSupplemental Update to cldr 42 2023-02-22 14:52:17 +00:00
LocalNames Merge branch 'REL1_41' of https://git.qiuwen.net.cn/Mirror/mediawiki-extensions-cldr 2024-02-20 12:07:11 +08:00
i18n Localisation updates from https://translatewiki.net. 2024-01-31 07:17:06 +01:00
includes Use HookHandlers for core hooks 2023-10-01 11:13:26 +02:00
tests/phpunit Load CLDR localisation for 'kok' for MediaWiki code 'gom-deva' 2023-10-02 18:38:08 +00:00
.eslintrc.json build: Updating mediawiki/mediawiki-codesniffer to 33.0.0 2020-11-05 01:23:47 +00:00
.gitignore build: Updating eslint-utils to 1.4.2 2019-08-24 02:40:12 +00:00
.gitreview Whoops, track not trace 2016-10-24 17:04:19 -07:00
.phpcs.xml Remove unused CldrCurrencies/CldrCurrency 2022-03-01 13:06:50 +00:00
CODE_OF_CONDUCT.md build: Updating mediawiki/phan-taint-check-plugin to 1.3.0 2018-08-19 18:35:51 +00:00
COPYING License information 2016-03-05 21:51:52 +00:00
Gruntfile.js build: Use existing eslint also for json linting 2020-09-11 23:55:28 +02:00
LICENSE Use HTTPS instead of HTTP where possible 2019-07-04 10:56:00 +02:00
Makefile Update to cldr 43 2023-05-08 08:19:28 +00:00
README Fix typo in README: trough -> through 2020-07-20 19:29:57 -04:00
composer.json build: Updating dependencies 2023-04-29 16:16:17 +00:00
extension.json Use HookHandlers for core hooks 2023-10-01 11:13:26 +02:00
package-lock.json build: Updating npm dependencies 2024-02-10 04:23:31 +00:00
package.json build: Updating grunt-banana-checker to 0.11.0 2023-06-02 07:09:28 +00:00
rebuild.php Load CLDR localisation for 'kok' for MediaWiki code 'gom-deva' 2023-10-02 18:38:08 +00:00

README

This extension contains local language names for different languages extracted
from CLDR data.

== Installation ==
Include it in LocalSettings.php:
 wfLoadExtension( 'cldr' );

== Updating data ==

Download newest data from CLDR site:
 https://www.unicode.org/cldr/repository_access.html

Example:
 wget https://www.unicode.org/Public/cldr/28/core.zip
 unzip core.zip -d core
 php rebuild.php

== Usage ==
<source lang=php>
	if ( is_callable( [ LanguageNames::class, 'getNames' ] ) ) {
		$languages = LanguageNames::getNames( 'en' ,
			LanguageNames::FALLBACK_NORMAL,
			LanguageNames::LIST_MW_AND_CLDR
		);
	} else {
		// If need to display something, use this as fallback
		$languages = Language::getLanguageNames( false );
	}
</source>

=== Parameters ===

For fallback:
* '''FALLBACK_NATIVE''': Go straight to MediaWiki's name entries
* '''FALLBACK_NORMAL''': Go through the fallback chain

For which languages to return:
* '''LIST_MW_SUPPORTED''': Only languages that has localisation in MediaWiki
* '''LIST_MW''': All languages that are in Names.php
* '''LIST_MW_AND_CLDR''': All languages that are either in MediaWiki or in cldr