PHP 클래스 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. This class also provides access to culture-specific instances of DateTimeFormatInfo and NumberFormatInfo. These objects contain the information required for culture-specific operations, such as formatting dates, numbers and currency. The culture names follow the format "_", where is a lowercase two-letter code derived from ISO 639 codes. You can find a full list of the ISO-639 codes at http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt The 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".
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$properties array A list of properties that are accessable/writable.

공개 메소드들

메소드 설명
__construct ( $culture = 'en' ) : return Initializes a new instance of the CultureInfo class based on the culture specified by name. E.g. new CultureInfo('en_AU'); The culture indentifier must be of the form "language_(country/region/variant)".
__get ( $name ) : mixed Allow functions that begins with 'set' to be called directly as an attribute/property to retrieve the value.
__set ( $name, $value ) Allow functions that begins with 'set' to be called directly as an attribute/property to set the value.
__toString ( ) : string Display the culture name.
getCalendar ( ) : string Gets the default calendar used by the culture, e.g. "gregorian".
getCountries ( ) : array Get a list of countries in the language of the localized version.
getCultures ( $type = CultureInfo::ALL ) : array 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.
getCurrencies ( ) : array Get a list of currencies in the language of the localized version.
getDateTimeFormat ( ) : DateTimeFormatInfo Gets the DateTimeFormatInfo that defines the culturally appropriate format of displaying dates and times.
getEnglishName ( ) : string Gets the culture name in English.
getInstance ( $culture ) : CultureInfo Gets the CultureInfo that for this culture string
getInvariantCulture ( ) : CultureInfo Gets the CultureInfo that is culture-independent (invariant).
getIsNeutralCulture ( ) : boolean Gets a value indicating whether the current CultureInfo represents a neutral culture. Returns true if the culture only contains two characters.
getLanguages ( ) : array Get a list of languages in the language of the localized version.
getName ( ) : string Gets the culture name in the format "_(country/regioncode2)".
getNativeName ( ) : array 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.
getNumberFormat ( ) : NumberFormatInfo Gets the NumberFormatInfo that defines the culturally appropriate format of displaying numbers, currency, and percentage.
getParent ( ) : CultureInfo Gets the CultureInfo that represents the parent culture of the current CultureInfo
getScripts ( ) : array Get a list of scripts in the language of the localized version.
getTimeZones ( ) : array Get a list of timezones in the language of the localized version.
setDateTimeFormat ( $dateTimeFormat ) Set the date time format information.
setNumberFormat ( $numberFormat ) Set the number format information.
validCulture ( $culture ) : boolean Determine if a given culture is valid. Simply checks that the culture data exists.

보호된 메소드들

메소드 설명
dataDir ( ) : string Get the default directory for the ICU data.
fileExt ( ) : string Get the filename extension for ICU data. Default is ".dat".
findInfo ( $path = '/', $merge = false ) : mixed Find the specific ICU data information from the data.
getData ( $filename ) : array Get the data by unserializing the ICU data from disk.
loadCultureData ( $culture ) Load the ICU culture data for the specific culture identifier.
setCulture ( $culture ) Set the culture for the current instance. The culture indentifier must be of the form "_(country/region)".

비공개 메소드들

메소드 설명
searchArray ( $info, $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.
simplify ( $array ) : array Simplify a single element array into its own value.

메소드 상세

__construct() 공개 메소드

Initializes a new instance of the CultureInfo class based on the culture specified by name. E.g. new CultureInfo('en_AU'); The culture indentifier must be of the form "language_(country/region/variant)".
public __construct ( $culture = 'en' ) : return
리턴 return new CultureInfo.

__get() 공개 메소드

Allow functions that begins with 'set' to be called directly as an attribute/property to retrieve the value.
public __get ( $name ) : mixed
리턴 mixed

__set() 공개 메소드

Allow functions that begins with 'set' to be called directly as an attribute/property to set the value.
public __set ( $name, $value )

__toString() 공개 메소드

Display the culture name.
또한 보기: getName()
public __toString ( ) : string
리턴 string the culture name.

dataDir() 보호된 정적인 메소드

The default is the "data" directory for this class.
protected static dataDir ( ) : string
리턴 string directory containing the ICU data.

fileExt() 보호된 정적인 메소드

Get the filename extension for ICU data. Default is ".dat".
protected static fileExt ( ) : string
리턴 string filename extension for ICU data.

findInfo() 보호된 메소드

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);.
protected findInfo ( $path = '/', $merge = false ) : mixed
리턴 mixed the specific ICU data.

getCalendar() 공개 메소드

Gets the default calendar used by the culture, e.g. "gregorian".
public getCalendar ( ) : string
리턴 string the default calendar.

getCountries() 공개 메소드

Get a list of countries in the language of the localized version.
public getCountries ( ) : array
리턴 array a list of localized country names.

getCultures() 정적인 공개 메소드

This function can be called statically.
static public getCultures ( $type = CultureInfo::ALL ) : array
리턴 array list of culture information available.

getCurrencies() 공개 메소드

Get a list of currencies in the language of the localized version.
public getCurrencies ( ) : array
리턴 array a list of localized currencies.

getData() 보호된 메소드

The data files are cached in a static variable inside this function.
protected getData ( $filename ) : array
리턴 array ICU data

getDateTimeFormat() 공개 메소드

Gets the DateTimeFormatInfo that defines the culturally appropriate format of displaying dates and times.
public getDateTimeFormat ( ) : DateTimeFormatInfo
리턴 DateTimeFormatInfo date time format information for the culture.

getEnglishName() 공개 메소드

Returns array('Language','Country'); 'Country' is omitted if the culture is neutral.
public getEnglishName ( ) : string
리턴 string language (country), it may locale code string if english name does not exist.

getInstance() 공개 정적인 메소드

Gets the CultureInfo that for this culture string
public static getInstance ( $culture ) : CultureInfo
리턴 CultureInfo invariant culture info is "en".

getInvariantCulture() 정적인 공개 메소드

Any changes to the invariant culture affects all other instances of the invariant culture. The invariant culture is assumed to be "en";
static public getInvariantCulture ( ) : CultureInfo
리턴 CultureInfo invariant culture info is "en".

getIsNeutralCulture() 공개 메소드

Gets a value indicating whether the current CultureInfo represents a neutral culture. Returns true if the culture only contains two characters.
public getIsNeutralCulture ( ) : boolean
리턴 boolean true if culture is neutral, false otherwise.

getLanguages() 공개 메소드

Get a list of languages in the language of the localized version.
public getLanguages ( ) : array
리턴 array list of localized language names.

getName() 공개 메소드

Gets the culture name in the format "_(country/regioncode2)".
public getName ( ) : string
리턴 string culture name.

getNativeName() 공개 메소드

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.
public getNativeName ( ) : array
리턴 array array with language and country as elements, localized.

getNumberFormat() 공개 메소드

Gets the NumberFormatInfo that defines the culturally appropriate format of displaying numbers, currency, and percentage.
public getNumberFormat ( ) : NumberFormatInfo
리턴 NumberFormatInfo the number format info for current culture.

getParent() 공개 메소드

Gets the CultureInfo that represents the parent culture of the current CultureInfo
public getParent ( ) : CultureInfo
리턴 CultureInfo parent culture information.

getScripts() 공개 메소드

Get a list of scripts in the language of the localized version.
public getScripts ( ) : array
리턴 array list of localized script names.

getTimeZones() 공개 메소드

Get a list of timezones in the language of the localized version.
public getTimeZones ( ) : array
리턴 array list of localized timezones.

loadCultureData() 보호된 메소드

Load the ICU culture data for the specific culture identifier.
protected loadCultureData ( $culture )

setCulture() 보호된 메소드

Set the culture for the current instance. The culture indentifier must be of the form "_(country/region)".
protected setCulture ( $culture )

setDateTimeFormat() 공개 메소드

Set the date time format information.
public setDateTimeFormat ( $dateTimeFormat )

setNumberFormat() 공개 메소드

Set the number format information.
public setNumberFormat ( $numberFormat )

validCulture() 공개 정적인 메소드

Determine if a given culture is valid. Simply checks that the culture data exists.
public static validCulture ( $culture ) : boolean
리턴 boolean true if valid, false otherwise.

프로퍼티 상세

$properties 보호되어 있는 프로퍼티

A list of properties that are accessable/writable.
protected array $properties
리턴 array