Zend Framework
LICENSE
This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.
Base class for localization
BROWSER = 'browser'
Autosearch constants
ENVIRONMENT = 'environment'
ZFDEFAULT = 'default'
string $_auto = ''
Automatic detected locale
boolean $_breakChain = 'false'
Internal variable
string $_browser = ''
Browser detected locale
string $_default = 'array'
Default locale
string $_environment = ''
Environment detected locale
string $_locale = ''
Actual set locale
array $_localeData = 'array'
Class wide Locale Constants
array $_territoryData = 'array'
Class wide Locale Constants
boolean $compatibilityMode = 'false'
Defines if old behaviour should be supported Old behaviour throws notices and will be deleted in future releases
__construct(
string|Zend_Locale $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
__toString(
)
:
string
Returns a string representation of the object Alias for toString
_prepareLocale(
string|Zend_Locale $locale, boolean $strict
=
false
)
:
string
Internal function, returns a single locale on detection
_prepareQuestionString(
string $input
)
:
string
Internal function for preparing the returned question regex string
clearCache(
)
:
void
Clears all set cache data
disableCache(
boolean $flag
)
:
void
Disables the set cache
equals(
Zend_Locale $object
)
:
boolean
Returns true if both locales are equal
findLocale(
string $locale
=
null
)
:
string
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
getBrowser(
)
:
array
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
getCache(
)
:
Zend_Cache_Core
Returns the set cache
getCountryTranslation(
string $value, string|Zend_Locale $locale
=
null
)
:
array
Returns the localized country name
getCountryTranslationList(
string|Zend_Locale $locale
=
null
)
:
array
Returns an array with the name of all countries translated to the given language
getDefault(
)
:
array
Return the default locale
getEnvironment(
)
:
array
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
getHttpCharset(
)
:
string
Return the accepted charset of the client
getLanguage(
)
:
string
Returns the language part of the locale
getLanguageTranslation(
string $value, string $locale
=
null
)
:
array
Returns the localized language name
getLanguageTranslationList(
string|Zend_Locale $locale
=
null
)
:
array
Returns an array with the name of all languages translated to the given language
getLocaleList(
)
:
array
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
getLocaleToTerritory(
string $territory
)
:
string|null
Returns the expected locale for a given territory
getOrder(
$order
=
null
)
:
array
Search the locale automatically and return all used locales ordered by quality
Standard Searchorder is Browser, Environment, Default
getQuestion(
string|Zend_Locale $locale
=
null
)
:
array
Returns an array with translated yes strings
getRegion(
)
:
string|false
Returns the region part of the locale if available
getScriptTranslation(
string $value, string $locale
=
null
)
:
array
Returns the localized script name
getScriptTranslationList(
string|Zend_Locale $locale
=
null
)
:
array
Returns an array with the name of all scripts translated to the given language
getTerritoryTranslation(
string $value, string|Zend_Locale $locale
=
null
)
:
array
Returns the localized territory name All territories contains other countries.
getTerritoryTranslationList(
string|Zend_Locale $locale
=
null
)
:
array
Returns an array with the name of all territories translated to the given language All territories contains other countries.
getTranslation(
string $value
=
null, string $path
=
null, string|Zend_Locale $locale
=
null
)
:
string|false
Returns a localized information string, supported are several types of informations.
For detailed information about the types look into the documentation
getTranslationList(
string $path
=
null, string|Zend_Locale $locale
=
null, string $value
=
null
)
:
array
Returns localized informations as array, supported are several types of informations.
For detailed information about the types look into the documentation
hasCache(
)
:
boolean
Returns true when a cache is set
isLocale(
string|Zend_Locale $locale, boolean $strict
=
false, boolean $compatible
=
true
)
:
boolean
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
removeCache(
)
:
void
Removes any set cache
serialize(
)
:
string
Serialization Interface
setCache(
Zend_Cache_Core $cache
)
:
void
Sets a cache
setDefault(
string|Zend_Locale $locale, float $quality
=
1
)
:
void
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
setLocale(
string|Zend_Locale $locale
=
null
)
:
void
Sets a new locale
toString(
)
:
string
Returns a string representation of the object