Class Zend_Locale

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

Located in /Zend/Locale.php (line 37)


	
			
Class Constant Summary
Method Summary
 static false|string isLocale (string|Zend_Locale $locale, [boolean $create = false])
 boolean equals ( $object)
 object __construct ([string $locale = null])
 array getBrowser ()
 array getCalendarDisplay (string $calendar, [string $locale = null])
 array getCalendarList ([string $locale = null])
 locale getDefault ([$searchorder $searchorder = null], [$fastsearch $fastsearch = null])
 array getEnvironment ()
 void getFramework ()
 void getHTTPCharset ()
 language getLanguage ()
 array getLanguageDisplay (string $language, [string $locale = null])
 array getLanguageList ([string $locale = null])
 array getQuestion ([string $locale = null])
 region getRegion ()
 array getRegionDisplay (string $region, [string $locale = null])
 array getRegionList ([string $locale = null])
 array getScriptDisplay (string $script, [string $locale = null])
 array getScriptList ([string $locale = null])
 string serialize ()
 void setLocale ([mixed $locale = null])
 string toString ()
 string __toString ()
Methods
static isLocale (line 931)

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
equals (line 731)

Returns true if both locales are equal

  • access: public
boolean equals ( $object)
  • $object
Constructor __construct (line 429)

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
getBrowser (line 576)

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 ()
getCalendarDisplay (line 882)

Returns an single calendar name translated for the actual locale

  • access: public
array getCalendarDisplay (string $calendar, [string $locale = null])
  • string $calendar
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getCalendarList (line 865)

Returns an array of calendar names translated for the actual locale

  • access: public
array getCalendarList ([string $locale = null])
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getDefault (line 486)

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
  • access: public
  • todo: - getFramework
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 533)

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 622)

Returns the locale which the framework is set to

  • access: public
void getFramework ()
getHTTPCharset (line 695)

Return the accepted charset of the client

  • access: public
  • todo: verify working
void getHTTPCharset ()
getLanguage (line 668)

Returns the language part of the locale

  • access: public
language getLanguage ()
getLanguageDisplay (line 764)

Returns an single language translated for the actual locale

  • access: public
array getLanguageDisplay (string $language, [string $locale = null])
  • string $language
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getLanguageList (line 747)

Returns an array of languages translated for the actual locale

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

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 680)

Returns the region part of the locale if avaiable

  • access: public
region getRegion ()
getRegionDisplay (line 843)

Returns an single region translated for the actual locale

  • access: public
array getRegionDisplay (string $region, [string $locale = null])
  • string $region
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getRegionList (line 825)

Returns an array of regions translated for the actual locale

  • access: public
array getRegionList ([string $locale = null])
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getScriptDisplay (line 803)

Returns a single script translated for a locale

  • access: public
array getScriptDisplay (string $script, [string $locale = null])
  • string $script
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
getScriptList (line 786)

Returns an array of scripts translated for the actual locale

  • access: public
array getScriptList ([string $locale = null])
  • string $locale: OPTIONAL locale for language translation (defaults to $this locale)
serialize (line 443)

Serialization Interface

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

Sets a new locale

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

Returns a string representation of the object

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

Returns a string representation of the object Alias for toString

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

Autosearch constants

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

Documentation generated on Thu, 18 Jan 2007 09:56:22 -0800 by phpDocumentor 1.3.1