CLDR 扩展包含从 CLDR 数据中提取的不同语言、国家和货币的本地化名称

安装数: 7,756

依赖者: 0

建议者: 1

安全: 0

星标: 7

关注者: 7

分支: 9

类型: mediawiki-extension

2024.07 2024-07-25 07:46 UTC

This package is auto-updated.

Last update: 2024-09-22 23:30:23 UTC


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