mediawiki/cldr
最新稳定版本:2026.02
Composer 安装命令:
composer require mediawiki/cldr
包简介
CLDR extension contains local language names for different languages, countries, and currencies extracted from CLDR data
README 文档
README
This extension extracts a subset of core CLDR data and makes it available to PHP.
Currently, it provides the following:
- Country names
- Currency names and symbols
- Language names
- Units of time
Installation
Clone the source to MediaWiki extensions/ and enable it in LocalSettings.php:
wfLoadExtension( 'cldr' );
Updating data
Look up the latest release of CLDR and note the version number.
Update the version number in CLDR_CORE_URL in Makefile. Run make:
make all
Example usage
if ( ExtensionRegistry::isLoaded( 'cldr' ) ) { // Get the English translation of all available language names. $languages = LanguageNames::getNames( 'en' , LanguageNames::FALLBACK_NATIVE, LanguageNames::LIST_MW_AND_CLDR ); } else { // Fall back to the MediaWiki core function without CLDR. $languages = Language::getLanguageNames( false ); }
统计信息
- 总下载量: 9.07k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2015-01-03