Class Zend_Locale

Description
  • copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Locale.php (line 36)


	
			
Class Constant Summary
Method Summary
 static false|string isLocale (string|Zend_Locale $locale, [boolean $create = false])
 object __construct ([string $locale = null])
 boolean equals ( $object)
 array getBrowser ()
 array getCountryTranslation (string $what, [string $locale = null])
 array getCountryTranslationList ([string $locale = null])
 locale getDefault ([$searchorder $searchorder = null], [$fastsearch $fastsearch = null])
 array getEnvironment ()
 void getFramework ()
 void getHttpCharset ()
 language getLanguage ()
 array getLanguageTranslation (string $what, [string $locale = null])
 array getLanguageTranslationList ([string $locale = null])
 array getQuestion ([string $locale = null])
 region getRegion ()
 array getScriptTranslation (string $what, [string $locale = null])
 array getScriptTranslationList ([string $locale = null])
 array getTerritoryTranslation (string $what, [string $locale = null])
 array getTerritoryTranslationList ([string $locale = null])
 string|array getTranslation (string $what, [string $type = null], [string|locale $locale = null])
 array getTranslationList ([string $type = null], [string|locale $locale = null])
 string serialize ()
 void setLocale ([mixed $locale = null])
 string toString ()
 string __toString ()
Methods
static isLocale (line 1150)

Checks if a locale identifier is a real locale or not

Examples: "en_XX" refers to "en", which returns true "XX_yy" refers to "root", which returns false

  • return: false if given locale is not a locale, else the locale identifier is returned
  • access: public
static false|string isLocale (string|Zend_Locale $locale, [boolean $create = false])
  • string|Zend_Locale $locale: Locale to check for
  • boolean $create: If true, create a default locale, if $locale is empty
Constructor __construct (line 428)

Generates a locale object

If no locale is given a automatic search is done Then the most probable locale will be automatically set Search order is

  1. Given Locale
  2. HTTP Client
  3. Server Environment
  4. Framework Standard

  • access: public
object __construct ([string $locale = null])
  • string $locale: OPTIONAL locale for parsing input
equals (line 730)

Returns true if both locales are equal

  • access: public
boolean equals ( $object)
  • $object
getBrowser (line 575)

Return an array of all accepted languages of the client Expects RFC compilant Header !!

The notation can be : de,en-UK-US;q=0.5,fr-FR;q=0.2

  • return: - list of accepted languages including quality
  • access: public
array getBrowser ()
getCountryTranslation (line 1096)

Returns the localized country name

  • access: public
array getCountryTranslation (string $what, [string $locale = null])
  • string $what: Name to get detailed information about
  • string $locale: OPTIONAL locale for country translation
getCountryTranslationList (line 895)

Returns an array with the name of all countries translated to the given language

  • access: public
array getCountryTranslationList ([string $locale = null])
  • string $locale: OPTIONAL locale for country translation
getDefault (line 485)

Search the locale automatically and return all used locales ordered by quality

Standard Searchorder is

  • getBrowser
  • getEnvironment

  • return: - returns an array of all the mosta locale string
  • todo: - getFramework
  • access: public
locale getDefault ([$searchorder $searchorder = null], [$fastsearch $fastsearch = null])
  • $searchorder $searchorder: - OPTIONAL searchorder
  • $fastsearch $fastsearch: - OPTIONAL returnes the first found locale array when true otherwise all found default locales will be returned
getEnvironment (line 532)

Expects the Systems standard locale

For Windows: f.e.: LC_COLLATE=C;LC_CTYPE=German_Austria.1252;LC_MONETARY=C would be recognised as de_AT

  • access: public
array getEnvironment ()
getFramework (line 621)

Returns the locale which the framework is set to

  • access: public
void getFramework ()
getHttpCharset (line 694)

Return the accepted charset of the client

  • todo: verify working
  • access: public
void getHttpCharset ()
getLanguage (line 667)

Returns the language part of the locale

  • access: public
language getLanguage ()
getLanguageTranslation (line 1070)

Returns the localized language name

  • access: public
array getLanguageTranslation (string $what, [string $locale = null])
  • string $what: Name to get detailed information about
  • string $locale: OPTIONAL locale for language translation
getLanguageTranslationList (line 871)

Returns an array with the name of all languages translated to the given language

  • access: public
array getLanguageTranslationList ([string $locale = null])
  • string $locale: OPTIONAL locale for language translation
getQuestion (line 1122)

Returns an array with translated yes strings

  • access: public
array getQuestion ([string $locale = null])
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getRegion (line 679)

Returns the region part of the locale if avaiable

  • access: public
region getRegion ()
getScriptTranslation (line 1083)

Returns the localized script name

  • access: public
array getScriptTranslation (string $what, [string $locale = null])
  • string $what: Name to get detailed information about
  • string $locale: OPTIONAL locale for script translation
getScriptTranslationList (line 883)

Returns an array with the name of all scripts translated to the given language

  • access: public
array getScriptTranslationList ([string $locale = null])
  • string $locale: OPTIONAL locale for script translation
getTerritoryTranslation (line 1110)

Returns the localized territory name All territories contains other countries.

  • access: public
array getTerritoryTranslation (string $what, [string $locale = null])
  • string $what: Name to get detailed information about
  • string $locale: OPTIONAL locale for territory translation
getTerritoryTranslationList (line 908)

Returns an array with the name of all territories translated to the given language All territories contains other countries.

  • access: public
array getTerritoryTranslationList ([string $locale = null])
  • string $locale: OPTIONAL locale for territory translation
getTranslation (line 928)

Returns a localized information string, supported are several types of informations.

Supported types are: 'language', 'script', 'country', 'territory', 'calendar', 'month', 'month_short', 'month_narrow', 'day', 'day_short', 'day_narrow', 'dateformat', 'timeformat', 'timezone', 'currency', 'currency_sign', 'currency_detail', 'territory_detail', 'language_detail', 'characters' For detailed information about the types look into the documentation

  • return: Array with the wished information in the given language
  • access: public
string|array getTranslation (string $what, [string $type = null], [string|locale $locale = null])
  • string $what: Name to get detailed information about
  • string $type: OPTIONAL Type of information to return
  • string|locale $locale: OPTIONAL Locale|Language for which this informations should be returned
getTranslationList (line 754)

Returns localized informations as array, supported are several types of informations.

Supported types are: 'language', 'script', 'country', 'territory', 'calendar', 'month', 'month_short', 'month_narrow', 'day', 'day_short', 'day_narrow', 'dateformat', 'timeformat', 'timezone', 'currency', 'currency_sign', 'currency_detail', 'territory_detail' 'language_detail', 'characters' For detailed information about the types look into the documentation

  • return: Array with the wished information in the given language
  • access: public
array getTranslationList ([string $type = null], [string|locale $locale = null])
  • string $type: OPTIONAL Type of information to return
  • string|locale $locale: OPTIONAL Locale|Language for which this informations should be returned
serialize (line 442)

Serialization Interface

  • access: public
string serialize ()
setLocale (line 633)

Sets a new locale

  • access: public
void setLocale ([mixed $locale = null])
  • mixed $locale: OPTIONAL new locale to set
toString (line 453)

Returns a string representation of the object

  • access: public
string toString ()
__toString (line 465)

Returns a string representation of the object Alias for toString

  • access: public
string __toString ()
Class Constants
BROWSER = 1 (line 398)

Autosearch constants

ENVIRONMENT = 2 (line 399)
FRAMEWORK = 3 (line 400)

Documentation generated on Sun, 27 May 2007 23:25:26 -0700 by phpDocumentor 1.3.2