[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/I18N/core/ -> CultureInfo.php (sommaire)

CultureInfo class file. This program is free software; you can redistribute it and/or modify it under the terms of the BSD License.

Author: Wei Zhuo
Version: $Id: CultureInfo.php 1397 2006-09-07 07:55:53Z wei $
Poids: 618 lignes (16 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

CultureInfo:: (30 méthodes):
  __toString()
  __get()
  __set()
  __construct()
  dataDir()
  fileExt()
  validCulture()
  setCulture()
  loadCultureData()
  getData()
  findInfo()
  searchArray()
  getName()
  getDateTimeFormat()
  setDateTimeFormat()
  getCalendar()
  getNativeName()
  getEnglishName()
  getInvariantCulture()
  getIsNeutralCulture()
  getNumberFormat()
  setNumberFormat()
  getParent()
  getCultures()
  simplify()
  getCountries()
  getCurrencies()
  getLanguages()
  getScripts()
  getTimeZones()


Classe: CultureInfo  - X-Ref

CultureInfo class.

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 "<languagecode>_<country/regioncode>",
where <languagecode> 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 <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".

__toString()   X-Ref
Display the culture name.

return: string the culture name.

__get($name)   X-Ref
Allow functions that begins with 'set' to be called directly
as an attribute/property to retrieve the value.

return: mixed

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


__construct($culture='en')   X-Ref
Initializes a new instance of the CultureInfo class based on the
culture specified by name. E.g. <code>new CultureInfo('en_AU');</cdoe>
The culture indentifier must be of the form
"language_(country/region/variant)".

param: string a culture name, e.g. "en_AU".
return: return new CultureInfo.

dataDir()   X-Ref
Get the default directory for the ICU data.
The default is the "data" directory for this class.

return: string directory containing the ICU data.

fileExt()   X-Ref
Get the filename extension for ICU data. Default is ".dat".

return: string filename extension for ICU data.

validCulture($culture)   X-Ref
Determine if a given culture is valid. Simply checks that the
culture data exists.

param: string a culture
return: boolean true if valid, false otherwise.

setCulture($culture)   X-Ref
Set the culture for the current instance. The culture indentifier
must be of the form "<language>_(country/region)".

param: string culture identifier, e.g. "fr_FR_EURO".

loadCultureData($culture)   X-Ref
Load the ICU culture data for the specific culture identifier.

param: string the culture identifier.

getData($filename)   X-Ref
Get the data by unserializing the ICU data from disk.
The data files are cached in a static variable inside
this function.

param: string the ICU data filename
return: array ICU data

findInfo($path='/', $merge=false)   X-Ref
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);.

param: string the data you want to find.
param: boolean merge the data from its parents.
return: mixed the specific ICU data.

searchArray($info, $path='/')   X-Ref
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.

param: array the array for search
param: string slash "/" separated array path.
return: mixed the value array using the path

getName()   X-Ref
Gets the culture name in the format
"<languagecode2>_(country/regioncode2)".

return: string culture name.

getDateTimeFormat()   X-Ref
Gets the DateTimeFormatInfo that defines the culturally appropriate
format of displaying dates and times.

return: DateTimeFormatInfo date time format information for the culture.

setDateTimeFormat($dateTimeFormat)   X-Ref
Set the date time format information.

param: DateTimeFormatInfo the new date time format info.

getCalendar()   X-Ref
Gets the default calendar used by the culture, e.g. "gregorian".

return: string the default calendar.

getNativeName()   X-Ref
Gets the culture name in the language that the culture is set
to display. Returns <code>array('Language','Country');</code>
'Country' is omitted if the culture is neutral.

return: array array with language and country as elements, localized.

getEnglishName()   X-Ref
Gets the culture name in English.
Returns <code>array('Language','Country');</code>
'Country' is omitted if the culture is neutral.

return: array array with language and country as elements.

getInvariantCulture()   X-Ref
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";

return: CultureInfo invariant culture info is "en".

getIsNeutralCulture()   X-Ref
Gets a value indicating whether the current CultureInfo
represents a neutral culture. Returns true if the culture
only contains two characters.

return: boolean true if culture is neutral, false otherwise.

getNumberFormat()   X-Ref
Gets the NumberFormatInfo that defines the culturally appropriate
format of displaying numbers, currency, and percentage.

return: NumberFormatInfo the number format info for current culture.

setNumberFormat($numberFormat)   X-Ref
Set the number format information.

param: NumberFormatInfo the new number format info.

getParent()   X-Ref
Gets the CultureInfo that represents the parent culture of the
current CultureInfo

return: CultureInfo parent culture information.

getCultures($type=CultureInfo::ALL)   X-Ref
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.

param: int culture type, CultureInfo::ALL, CultureInfo::NEUTRAL
return: array list of culture information available.

simplify($array)   X-Ref
Simplify a single element array into its own value.
E.g. <code>array(0 => array('hello'), 1 => 'world');</code>
becomes <code>array(0 => 'hello', 1 => 'world');</code>

param: array with single elements arrays
return: array simplified array.

getCountries()   X-Ref
Get a list of countries in the language of the localized version.

return: array a list of localized country names.

getCurrencies()   X-Ref
Get a list of currencies in the language of the localized version.

return: array a list of localized currencies.

getLanguages()   X-Ref
Get a list of languages in the language of the localized version.

return: array list of localized language names.

getScripts()   X-Ref
Get a list of scripts in the language of the localized version.

return: array list of localized script names.

getTimeZones()   X-Ref
Get a list of timezones in the language of the localized version.

return: array list of localized timezones.



Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7