Class: CultureInfo
Source Location: /I18N/core/CultureInfo.php
CultureInfo class.
Class Details
|
|
|
|
Class Variables
Class Methods
constructor __construct [line 168]
return __construct(
[string
$culture = 'en'])
|
|
Initializes a new instance of the CultureInfo class based on the culture specified by name. E.g.
Parameters:
method dataDir [line 189]
Get the default directory for the ICU data. The default is the "data" directory for this class.
method fileExt [line 198]
Get the filename extension for ICU data. Default is ".dat".
method findInfo [line 306]
mixed findInfo(
[string
$path = '/'], [boolean
$merge = false])
|
|
Find the specific ICU data information from the data. The path to the specific ICU data is separated with a slash "/". E.g. To find the default calendar used by the culture, the path "calendar/default" will return the corresponding default calendar. Use merge=true to return the ICU including the parent culture. E.g. The currency data for a variant, say "en_AU" contains one entry, the currency for AUD, the other currency data are stored in the "en" data file. Thus to retrieve all the data regarding currency for "en_AU", you need to use findInfo("Currencies,true);.
Parameters:
method getCalendar [line 389]
Gets the default calendar used by the culture, e.g. "gregorian".
method getCountries [line 576]
Get a list of countries in the language of the localized version.
method getCultures [line 512]
array getCultures(
[int
$type = CultureInfo::ALL])
|
|
Gets the list of supported cultures filtered by the specified culture type. This is an EXPENSIVE function, it needs to traverse a list of ICU files in the data directory. This function can be called statically.
Parameters:
method getCurrencies [line 585]
Get a list of currencies in the language of the localized version.
method getData [line 278]
array &getData(
string
$filename)
|
|
Get the data by unserializing the ICU data from disk. The data files are cached in a static variable inside this function.
Parameters:
method getDateTimeFormat [line 364]
Gets the DateTimeFormatInfo that defines the culturally appropriate format of displaying dates and times.
method getEnglishName [line 419]
Gets the culture name in English. Returns - array('Language','Country');
'Country' is omitted if the culture is neutral.
method getInvariantCulture [line 440]
Gets the CultureInfo that is culture-independent (invariant). Any changes to the invariant culture affects all other instances of the invariant culture. The invariant culture is assumed to be "en";
method getIsNeutralCulture [line 454]
boolean getIsNeutralCulture(
)
|
|
Gets a value indicating whether the current CultureInfo represents a neutral culture. Returns true if the culture only contains two characters.
method getLanguages [line 594]
Get a list of languages in the language of the localized version.
method getName [line 354]
Gets the culture name in the format "<languagecode2>_(country/regioncode2)".
method getNativeName [line 401]
Gets the culture name in the language that the culture is set to display. Returns - array('Language','Country');
'Country' is omitted if the culture is neutral.
method getNumberFormat [line 464]
Gets the NumberFormatInfo that defines the culturally appropriate format of displaying numbers, currency, and percentage.
method getParent [line 494]
Gets the CultureInfo that represents the parent culture of the current CultureInfo
method getScripts [line 603]
Get a list of scripts in the language of the localized version.
method getTimeZones [line 612]
Get a list of timezones in the language of the localized version.
method loadCultureData [line 237]
void loadCultureData(
string
$culture)
|
|
Load the ICU culture data for the specific culture identifier.
Parameters:
method setCulture [line 222]
void setCulture(
string
$culture)
|
|
Set the culture for the current instance. The culture indentifier must be of the form "<language>_(country/region)".
Parameters:
method setDateTimeFormat [line 380]
Set the date time format information.
Parameters:
method setNumberFormat [line 484]
Set the number format information.
Parameters:
method validCulture [line 209]
boolean validCulture(
string
$culture)
|
|
Determine if a given culture is valid. Simply checks that the culture data exists.
Parameters:
method __get [line 137]
mixed __get(
mixed
$name)
|
|
Allow functions that begins with 'set' to be called directly as an attribute/property to retrieve the value.
method __set [line 150]
void __set(
mixed
$name, mixed
$value)
|
|
Allow functions that begins with 'set' to be called directly as an attribute/property to set the value.
method __toString [line 126]
Display the culture name.
Class Constants
|
|