Class Zend_Locale

Description

Base class for localization

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

Located in /Locale.php (line 30)


	
			
Class Constant Summary
 BROWSER = 'browser'
 ENVIRONMENT = 'environment'
 ZFDEFAULT = 'default'
Variable Summary
 static boolean $compatibilityMode
 static string $_auto
 static string $_browser
 static string $_default
 static string $_environment
 string $_locale
Method Summary
 static void clearCache ()
 static void disableCache (boolean $flag)
 static string findLocale ([string $locale = null])
 static array getBrowser ()
 static array getCountryTranslation (string $value, [string|Zend_Locale $locale = null])
 static array getCountryTranslationList ([string|Zend_Locale $locale = null])
 static array getDefault ()
 static array getEnvironment ()
 static string getHttpCharset ()
 static array getLanguageTranslation (string $value, [string $locale = null])
 static array getLanguageTranslationList ([string|Zend_Locale $locale = null])
 static array getLocaleList ()
 static array getOrder ([ $order = null], string $searchorder)
 static array getQuestion ([string|Zend_Locale $locale = null])
 static array getScriptTranslation (string $value, [string $locale = null])
 static array getScriptTranslationList ([string|Zend_Locale $locale = null])
 static array getTerritoryTranslation (string $value, [string|Zend_Locale $locale = null])
 static array getTerritoryTranslationList ([string|Zend_Locale $locale = null])
 static string|false getTranslation ([string $value = null], [string $path = null], [string|Zend_Locale $locale = null])
 static array getTranslationList ([string $path = null], [string|Zend_Locale $locale = null], [string $value = null])
 static boolean hasCache ()
 static boolean isLocale (string|Zend_Locale $locale, [boolean $strict = false], [boolean $compatible = true])
 static void removeCache ()
 static void setCache ( $cache)
 static void setDefault (string|Zend_Locale $locale, [float $quality = 1])
 Zend_Locale __construct ([string|Zend_Locale $locale = null])
 boolean equals (Zend_Locale $object)
 string getLanguage ()
 string|false getRegion ()
 string serialize ()
 void setLocale ([string|Zend_Locale $locale = null])
 string toString ()
 string __toString ()
Variables
static boolean $compatibilityMode = false (line 134)

Defines if old behaviour should be supported Old behaviour throws notices and will be deleted in future releases

  • access: public
static string $_auto (line 155)

Automatic detected locale

  • var: Locales
  • access: protected
static string $_browser (line 162)

Browser detected locale

  • var: Locales
  • access: protected
static string $_default = array('en' => true) (line 176)

Default locale

  • var: Locales
  • access: protected
static string $_environment (line 169)

Environment detected locale

  • var: Locales
  • access: protected
string $_locale (line 148)

Actual set locale

  • var: Locale
  • access: protected
Methods
static clearCache (line 899)

Clears all set cache data

  • access: public
static void clearCache ()
static disableCache (line 911)

Disables the set cache

  • access: public
static void disableCache (boolean $flag)
  • boolean $flag: True disables any set cache, default is false
static findLocale (line 800)

Finds the proper locale based on the input

Checks if it exists, degrades it when necessary Detects registry locale and when all fails tries to detect a automatic locale Returns the found locale as string

  • throws: Zend_Locale_Exception When the given locale is no locale or the autodetection fails
  • access: public
static string findLocale ([string $locale = null])
  • string $locale
static getBrowser (line 365)

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
static array getBrowser ()
static getCache (line 852)

Returns the set cache

  • return: The set cache
  • access: public
static Zend_Cache_Core getCache ()
static getCountryTranslation (line 651)

Returns the localized country name

  • deprecated:
  • access: public
static array getCountryTranslation (string $value, [string|Zend_Locale $locale = null])
  • string $value: Name to get detailed information about
  • string|Zend_Locale $locale: (Optional) Locale for country translation
static getCountryTranslationList (line 574)

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

  • deprecated:
  • access: public
static array getCountryTranslationList ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) Locale for country translation
static getDefault (line 233)

Return the default locale

  • return: Returns an array of all locale string
  • access: public
static array getDefault ()
static getEnvironment (line 305)

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
static array getEnvironment ()
static getHttpCharset (line 476)

Return the accepted charset of the client

  • access: public
static string getHttpCharset ()
static getLanguageTranslation (line 623)

Returns the localized language name

  • deprecated:
  • access: public
static array getLanguageTranslation (string $value, [string $locale = null])
  • string $value: Name to get detailed information about
  • string $locale: (Optional) Locale for language translation
static getLanguageTranslationList (line 548)

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

  • deprecated:
  • access: public
static array getLanguageTranslationList ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) Locale for language translation
static getLocaleList (line 837)

Returns a list of all known locales where the locale is the key Only real locales are returned, the internal locales 'root', 'auto', 'browser' and 'environment' are suppressed

  • return: List of all Locales
  • access: public
static array getLocaleList ()
static getOrder (line 998)

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

Standard Searchorder is Browser, Environment, Default

  • return: Returns an array of all detected locales
  • access: public
static array getOrder ([ $order = null], string $searchorder)
  • string $searchorder: (Optional) Searchorder
  • $order
static getQuestion (line 678)

Returns an array with translated yes strings

  • access: public
static array getQuestion ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) Locale for language translation (defaults to $this locale)
static getScriptTranslation (line 637)

Returns the localized script name

  • deprecated:
  • access: public
static array getScriptTranslation (string $value, [string $locale = null])
  • string $value: Name to get detailed information about
  • string $locale: (Optional) locale for script translation
static getScriptTranslationList (line 561)

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

  • deprecated:
  • access: public
static array getScriptTranslationList ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) Locale for script translation
static getTerritoryTranslation (line 666)

Returns the localized territory name All territories contains other countries.

  • deprecated:
  • access: public
static array getTerritoryTranslation (string $value, [string|Zend_Locale $locale = null])
  • string $value: Name to get detailed information about
  • string|Zend_Locale $locale: (Optional) Locale for territory translation
static getTerritoryTranslationList (line 588)

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

  • deprecated:
  • access: public
static array getTerritoryTranslationList ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) Locale for territory translation
static getTranslation (line 603)

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

For detailed information about the types look into the documentation

  • return: The wished information in the given language
  • access: public
static string|false getTranslation ([string $value = null], [string $path = null], [string|Zend_Locale $locale = null])
  • string $value: Name to get detailed information about
  • string $path: (Optional) Type of information to return
  • string|Zend_Locale $locale: (Optional) Locale|Language for which this informations should be returned
static getTranslationList (line 529)

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

For detailed information about the types look into the documentation

  • return: Array with the wished information in the given language
  • access: public
static array getTranslationList ([string $path = null], [string|Zend_Locale $locale = null], [string $value = null])
  • string $path: (Optional) Type of information to return
  • string|Zend_Locale $locale: (Optional) Locale|Language for which this informations should be returned
  • string $value: (Optional) Value for detail list
static hasCache (line 877)

Returns true when a cache is set

  • access: public
static boolean hasCache ()
static isLocale (line 750)

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: If the locale is known dependend on the settings
  • access: public
static boolean isLocale (string|Zend_Locale $locale, [boolean $strict = false], [boolean $compatible = true])
  • string|Zend_Locale $locale: Locale to check for
  • boolean $strict: (Optional) If true, no rerouting will be done when checking
  • boolean $compatible: (DEPRECIATED) Only for internal usage, brakes compatibility mode
static removeCache (line 888)

Removes any set cache

  • access: public
static void removeCache ()
static setCache (line 866)

Sets a cache

  • access: public
static void setCache ( $cache)
static setDefault (line 265)

Sets a new default locale which will be used when no locale can be detected

If provided you can set a quality between 0 and 1 (or 2 and 100) which represents the percent of quality the browser requested within HTTP

  • throws: Zend_Locale_Exception When a autolocale was given
  • throws: Zend_Locale_Exception When a unknown locale was given
  • access: public
static void setDefault (string|Zend_Locale $locale, [float $quality = 1])
  • string|Zend_Locale $locale: Locale to set
  • float $quality: The quality to set from 0 to 1
Constructor __construct (line 191)

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

  • throws: Zend_Locale_Exception When autodetection has been failed
  • access: public
Zend_Locale __construct ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) Locale for parsing input
equals (line 510)

Returns true if both locales are equal

  • access: public
boolean equals (Zend_Locale $object)
getLanguage (line 450)

Returns the language part of the locale

  • access: public
string getLanguage ()
getRegion (line 461)

Returns the region part of the locale if available

  • return: - Regionstring
  • access: public
string|false getRegion ()
serialize (line 202)

Serialization Interface

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

Sets a new locale

  • access: public
void setLocale ([string|Zend_Locale $locale = null])
  • string|Zend_Locale $locale: (Optional) New locale to set
toString (line 212)

Returns a string representation of the object

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

Returns a string representation of the object Alias for toString

  • access: public
string __toString ()
Class Constants
BROWSER = 'browser' (line 124)

Autosearch constants

ENVIRONMENT = 'environment' (line 125)
ZFDEFAULT = 'default' (line 126)

Documentation generated on Thu, 01 Apr 2010 13:13:21 -0400 by phpDocumentor 1.4.3