Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes | Protected Attributes | Static Protected Attributes

Zend_Locale Class Reference

Public Member Functions

 __construct ($locale=null)
 serialize ()
 toString ()
 __toString ()
 setLocale ($locale=null)
 getLanguage ()
 getRegion ()
 equals (Zend_Locale $object)

Static Public Member Functions

static getDefault ()
static setDefault ($locale, $quality=1)
static getEnvironment ()
static getBrowser ()
static getHttpCharset ()
static getTranslationList ($path=null, $locale=null, $value=null)
static getLanguageTranslationList ($locale=null)
static getScriptTranslationList ($locale=null)
static getCountryTranslationList ($locale=null)
static getTerritoryTranslationList ($locale=null)
static getTranslation ($value=null, $path=null, $locale=null)
static getLanguageTranslation ($value, $locale=null)
static getScriptTranslation ($value, $locale=null)
static getCountryTranslation ($value, $locale=null)
static getTerritoryTranslation ($value, $locale=null)
static getQuestion ($locale=null)
static isLocale ($locale, $strict=false, $compatible=true)
static findLocale ($locale=null)
static getLocaleList ()
static getCache ()
static setCache (Zend_Cache_Core $cache)
static hasCache ()
static removeCache ()
static clearCache ()
static disableCache ($flag)
static getOrder ($order=null)

Data Fields

const BROWSER = 'browser'
const ENVIRONMENT = 'environment'
const ZFDEFAULT = 'default'

Static Public Attributes

static $compatibilityMode = false

Protected Attributes

 $_locale

Static Protected Attributes

static $_auto
static $_browser
static $_environment
static $_default = array('en' => true)

Detailed Description

Definition at line 30 of file Locale.php.


Constructor & Destructor Documentation

__construct ( locale = null )

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

Parameters:
string | Zend_Locale$locale(Optional) Locale for parsing input
Exceptions:
Zend_Locale_ExceptionWhen autodetection has been failed

Definition at line 191 of file Locale.php.


Member Function Documentation

__toString (  )

Returns a string representation of the object Alias for toString

Returns:
string

Definition at line 223 of file Locale.php.

static clearCache (  ) [static]

Clears all set cache data

Returns:
void

Definition at line 899 of file Locale.php.

static disableCache ( flag ) [static]

Disables the set cache

Parameters:
boolean$flagTrue disables any set cache, default is false
Returns:
void

Definition at line 911 of file Locale.php.

equals ( Zend_Locale object )

Returns true if both locales are equal

Parameters:
Zend_Locale$objectLocale to check for equality
Returns:
boolean

Definition at line 510 of file Locale.php.

static findLocale ( locale = null ) [static]

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

Parameters:
string$locale
Exceptions:
Zend_Locale_ExceptionWhen the given locale is no locale or the autodetection fails
Returns:
string

Definition at line 800 of file Locale.php.

static getBrowser (  ) [static]

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

Returns:
array - list of accepted languages including quality

Definition at line 365 of file Locale.php.

static getCache (  ) [static]

Returns the set cache

Returns:
Zend_Cache_Core The set cache

Definition at line 852 of file Locale.php.

static getCountryTranslation ( value,
locale = null 
) [static]

Returns the localized country name

Parameters:
string$valueName to get detailed information about
string | Zend_Locale$locale(Optional) Locale for country translation
Returns:
array
Deprecated:

Definition at line 651 of file Locale.php.

static getCountryTranslationList ( locale = null ) [static]

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

Parameters:
string | Zend_Locale$locale(Optional) Locale for country translation
Returns:
array
Deprecated:

Definition at line 574 of file Locale.php.

static getDefault (  ) [static]

Return the default locale

Returns:
array Returns an array of all locale string

Definition at line 233 of file Locale.php.

static getEnvironment (  ) [static]

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

Returns:
array

Definition at line 305 of file Locale.php.

static getHttpCharset (  ) [static]

Return the accepted charset of the client

Returns:
string

Definition at line 476 of file Locale.php.

getLanguage (  )

Returns the language part of the locale

Returns:
string

Definition at line 450 of file Locale.php.

static getLanguageTranslation ( value,
locale = null 
) [static]

Returns the localized language name

Parameters:
string$valueName to get detailed information about
string$locale(Optional) Locale for language translation
Returns:
array
Deprecated:

Definition at line 623 of file Locale.php.

static getLanguageTranslationList ( locale = null ) [static]

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

Parameters:
string | Zend_Locale$locale(Optional) Locale for language translation
Returns:
array
Deprecated:

Definition at line 548 of file Locale.php.

static getLocaleList (  ) [static]

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

Returns:
array List of all Locales

Definition at line 837 of file Locale.php.

static getOrder ( order = null ) [static]

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

Standard Searchorder is Browser, Environment, Default

Parameters:
string$searchorder(Optional) Searchorder
Returns:
array Returns an array of all detected locales

Definition at line 998 of file Locale.php.

static getQuestion ( locale = null ) [static]

Returns an array with translated yes strings

Parameters:
string | Zend_Locale$locale(Optional) Locale for language translation (defaults to $this locale)
Returns:
array

Definition at line 678 of file Locale.php.

getRegion (  )

Returns the region part of the locale if available

Returns:
string|false - Regionstring

Definition at line 461 of file Locale.php.

static getScriptTranslation ( value,
locale = null 
) [static]

Returns the localized script name

Parameters:
string$valueName to get detailed information about
string$locale(Optional) locale for script translation
Returns:
array
Deprecated:

Definition at line 637 of file Locale.php.

static getScriptTranslationList ( locale = null ) [static]

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

Parameters:
string | Zend_Locale$locale(Optional) Locale for script translation
Returns:
array
Deprecated:

Definition at line 561 of file Locale.php.

static getTerritoryTranslation ( value,
locale = null 
) [static]

Returns the localized territory name All territories contains other countries.

Parameters:
string$valueName to get detailed information about
string | Zend_Locale$locale(Optional) Locale for territory translation
Returns:
array
Deprecated:

Definition at line 666 of file Locale.php.

static getTerritoryTranslationList ( locale = null ) [static]

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

Parameters:
string | Zend_Locale$locale(Optional) Locale for territory translation
Returns:
array
Deprecated:

Definition at line 588 of file Locale.php.

static getTranslation ( value = null,
path = null,
locale = null 
) [static]

Returns a localized information string, supported are several types of informations. For detailed information about the types look into the documentation

Parameters:
string$valueName 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
Returns:
string|false The wished information in the given language

Definition at line 603 of file Locale.php.

static getTranslationList ( path = null,
locale = null,
value = null 
) [static]

Returns localized informations as array, supported are several types of informations. For detailed information about the types look into the documentation

Parameters:
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
Returns:
array Array with the wished information in the given language

Definition at line 529 of file Locale.php.

static hasCache (  ) [static]

Returns true when a cache is set

Returns:
boolean

Definition at line 877 of file Locale.php.

static isLocale ( locale,
strict = false,
compatible = true 
) [static]

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

Parameters:
string | Zend_Locale$localeLocale 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
Returns:
boolean If the locale is known dependend on the settings

Definition at line 750 of file Locale.php.

static removeCache (  ) [static]

Removes any set cache

Returns:
void

Definition at line 888 of file Locale.php.

serialize (  )

Serialization Interface

Returns:
string

Definition at line 202 of file Locale.php.

static setCache ( Zend_Cache_Core cache ) [static]

Sets a cache

Parameters:
Zend_Cache_Core$cacheCache to set
Returns:
void

Definition at line 866 of file Locale.php.

static setDefault ( locale,
quality = 1 
) [static]

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

Parameters:
string | Zend_Locale$localeLocale to set
float$qualityThe quality to set from 0 to 1
Exceptions:
Zend_Locale_ExceptionWhen a autolocale was given
Zend_Locale_ExceptionWhen a unknown locale was given
Returns:
void

Definition at line 265 of file Locale.php.

setLocale ( locale = null )

Sets a new locale

Parameters:
string | Zend_Locale$locale(Optional) New locale to set
Returns:
void

Definition at line 423 of file Locale.php.

toString (  )

Returns a string representation of the object

Returns:
string

Definition at line 212 of file Locale.php.


Field Documentation

const BROWSER = 'browser'

Autosearch constants

Definition at line 124 of file Locale.php.


The documentation for this class was generated from the following file: