MediaWiki fundraising/REL1_35
CountryNames Class Reference

A class for querying translated country names from CLDR data. More...

Inheritance diagram for CountryNames:
Collaboration diagram for CountryNames:

Static Public Member Functions

static getNames ( $code)
 Get localized country names for a particular language, using fallback languages for missing items.
 
- Static Public Member Functions inherited from CldrNames
static getFileName ( $code)
 Get the name for the file that contains the CLDR data for a given language.
 
static getOverrideFileName ( $code)
 Get the name for the file that contains the local override data for a given language.
 

Static Private Member Functions

static loadLanguage ( $code)
 Load country names localized for a particular language.
 

Static Private Attributes

static $cache = []
 

Detailed Description

A class for querying translated country names from CLDR data.

Author
Niklas Laxström
Ryan Kaldari
Note
Copyright © 2007-2011
GPL-2.0-or-later

Definition at line 11 of file CountryNames.php.

Member Function Documentation

◆ getNames()

static CountryNames::getNames ( $code)
static

Get localized country names for a particular language, using fallback languages for missing items.

Parameters
string$codeThe language to return the list in
Returns
array an associative array of country codes and localized country names

Definition at line 22 of file CountryNames.php.

References $fallback, and loadLanguage().

Referenced by Gateway_Form_Mustache\getData(), and EmailPreferences\paramsForPreferencesForm().

◆ loadLanguage()

static CountryNames::loadLanguage ( $code)
staticprivate

Load country names localized for a particular language.

Helper function for getNames.

Parameters
string$codeThe language to return the list in
Returns
array an associative array of country codes and localized country names

Definition at line 42 of file CountryNames.php.

References $countryNames, CldrNames\getFileName(), CldrNames\getOverrideFileName(), and wfDebug().

Referenced by getNames().

Member Data Documentation

◆ $cache

CountryNames::$cache = []
staticprivate

Definition at line 13 of file CountryNames.php.


The documentation for this class was generated from the following file: