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
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
Returns true if both locales are equal
boolean
equals
( $object)
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
- Given Locale
- HTTP Client
- Server Environment
- Framework Standard
object
__construct
([string $locale = null])
-
string
$locale: OPTIONAL locale for parsing input
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
array
getBrowser
()
Returns an single calendar name translated for the actual locale
array
getCalendarDisplay
(string $calendar, [string $locale = null])
-
string
$calendar
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Returns an array of calendar names translated for the actual locale
array
getCalendarList
([string $locale = null])
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Search the locale automatically and return all used locales ordered by quality
Standard Searchorder is
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
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
array
getEnvironment
()
Returns the locale which the framework is set to
void
getFramework
()
Return the accepted charset of the client
void
getHttpCharset
()
Returns the language part of the locale
language
getLanguage
()
Returns an single language translated for the actual locale
array
getLanguageDisplay
(string $language, [string $locale = null])
-
string
$language
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Returns an array of languages translated for the actual locale
array
getLanguageList
([string $locale = null])
-
string
$locale: - OPTIONAL locale for language translation
Returns an array with translated yes strings
array
getQuestion
([string $locale = null])
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Returns the region part of the locale if avaiable
region
getRegion
()
Returns an single region translated for the actual locale
array
getRegionDisplay
(string $region, [string $locale = null])
-
string
$region
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Returns an array of regions translated for the actual locale
array
getRegionList
([string $locale = null])
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Returns a single script translated for a locale
array
getScriptDisplay
(string $script, [string $locale = null])
-
string
$script
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Returns an array of scripts translated for the actual locale
array
getScriptList
([string $locale = null])
-
string
$locale: OPTIONAL locale for language translation (defaults to $this locale)
Serialization Interface
string
serialize
()
Sets a new locale
void
setLocale
([mixed $locale = null])
-
mixed
$locale: OPTIONAL new locale to set
Returns a string representation of the object
string
toString
()
Returns a string representation of the object Alias for toString
string
__toString
()