MediaWiki extension cldr.

Clone this repo:
  1. 6831595 Add Levantine Arabic with Latin script by raymond · 2 weeks ago master wmf/1.44.0-wmf.16 wmf/branch_cut_pretest wmf/next
  2. b11245a build: Updating mediawiki/mediawiki-codesniffer to 46.0.0 by libraryupgrader · 2 weeks ago wmf/1.44.0-wmf.15
  3. 0ea36c8 Fix some Russian local names by Amir E. Aharoni · 3 weeks ago
  4. 0a22577 Consistent Ukrainian local names by Amir E. Aharoni · 3 weeks ago wmf/1.44.0-wmf.14
  5. 416d853 Add local names for Baltic Romani (Cyrillic; rml-cyrl) by Amir E. Aharoni · 3 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 );
	}