Class \Prado\I18N\core\CultureInfo
Represents information about a specific culture including the names of the culture, the calendar used, as well as access to culture-specific objects that provide methods for common operations, such as formatting dates, numbers, and currency.
The CultureInfo class holds culture-specific information, such as the associated language, sublanguage, country/region, calendar, and cultural conventions.
The culture names follow the format "
The <country/regioncode2> is an uppercase two-letter code derived from ISO 3166. A copy of ISO-3166 can be found at http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
For example, Australian English is "en_AU".
Class hierarchy
Author: Xiang Wei Zhuo <weizhuo[at]gmail[dot]com>Author: Fabio Bas <ctrlaltca[at]gmail[dot]com>
public
|
__construct([string $culture = 'en' ]) : mixed
Initializes a new instance of the CultureInfo class based on the
culture specified by name. E.g.
The culture indentifier must be of the form "language_(country/region/variant)". |
public
|
__get(mixed $name) : mixed
Allow functions that begins with 'set' to be called directly
as an attribute/property to retrieve the value.
|
public
|
__set(mixed $name, mixed $value) : mixed
Allow functions that begins with 'set' to be called directly
as an attribute/property to set the value.
|
public
|
|
public
|
findInfo([string $path = '/' ][, string $key = null ]) : mixed
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. |
public
|
|
public
|
getCountries() : array<string|int, mixed>
Get a list of countries in the language of the localized version.
|
public
static
|
getCultures([int $type = CultureInfo::ALL ]) : array<string|int, mixed>
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. |
public
|
getCurrencies() : array<string|int, mixed>
Get a list of currencies in the language of the localized version.
|
public
|
getEnglishName() : string
Gets the culture name in English.
Returns
'Country' is omitted if the culture is neutral. |
public
static
|
getInvariantCulture() : CultureInfo
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"; |
public
|
getIsNeutralCulture() : bool
Gets a value indicating whether the current CultureInfo
represents a neutral culture. Returns true if the culture
only contains two characters.
|
public
|
getLanguages() : array<string|int, mixed>
Get a list of languages in the language of the localized version.
|
public
|
|
public
|
getNativeName() : array<string|int, mixed>
Gets the culture name in the language that the culture is set
to display. Returns
```php
array('Language','Country');
```
'Country' is omitted if the culture is neutral.
|
public
|
getScripts() : array<string|int, mixed>
Get a list of scripts in the language of the localized version.
|
public
|
getTimeZones() : array<string|int, mixed>
Get a list of timezones in the language of the localized version.
|
public
static
|
validCulture(string $culture) : bool
Determine if a given culture is valid. Simply checks that the
culture data exists.
|
protected
|
|
protected
|
setCulture(string $culture) : mixed
Set the culture for the current instance. The culture indentifier
must be of the form "<language>_(country/region)".
|
protected
|
simplify(mixed $obj) : array<string|int, mixed>
Simplify a single element array into its own value.
E.g.
becomes
|
private
|
searchResources(array<string|int, mixed> $resource[, string $path = '/' ]) : mixed
Search the array for a specific value using a path separated using
slash "/" separated path. e.g to find $info['hello']['world'],
the path "hello/world" will return the corresponding value.
|
|
public
int
|
ALL
Culture type, all.
|
0
|
public
int
|
NEUTRAL
Culture type, neutral.
|
1
|
public
int
|
SPECIFIC
Culture type, specific.
|
2
|