MediaWiki extension cldr.

Clone this repo:
  1. e6101e0 build: Updating cross-spawn to 7.0.6 by libraryupgrader · 6 days ago master wmf/1.44.0-wmf.5 wmf/branch_cut_pretest wmf/next
  2. 106928f Add Likpakpaanl (Konkomba) local names by Amir E. Aharoni · 7 days ago
  3. 61d4349 Add local names for Xibe (sjo) by Amir E. Aharoni · 12 days ago wmf/1.44.0-wmf.4
  4. 22dc784 Add a local Indonesian name for btd by Amir E. Aharoni · 4 weeks ago wmf/1.44.0-wmf.3
  5. c2ad3e8 Add local names for Fur (fvr) by Amir E. Aharoni · 4 weeks ago

mediawiki/extensions/cldr

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 );
	}