Locale
class Locale
Replacement for PHP's native {@link \Locale} class.
The only methods supported in this class are getDefault
and canonicalize
.
All other methods will throw an exception when used.
Constants
DEFAULT_LOCALE |
|
ACTUAL_LOCALE |
|
VALID_LOCALE |
|
LANG_TAG |
|
EXTLANG_TAG |
|
SCRIPT_TAG |
|
REGION_TAG |
|
VARIANT_TAG |
|
GRANDFATHERED_LANG_TAG |
|
PRIVATE_TAG |
|
Methods
Not supported. Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616.
Returns a canonicalized locale string.
Not supported. Returns a correctly ordered and delimited locale code.
Not supported. Checks if a language tag filter matches with locale.
Not supported. Returns the variants for the input locale.
Returns the default locale.
Not supported. Returns the localized display name for the locale language.
Not supported. Returns the localized display name for the locale.
Not supported. Returns the localized display name for the locale region.
Not supported. Returns the localized display name for the locale script.
Not supported. Returns the localized display name for the locale variant.
Not supported. Returns the keywords for the locale.
Not supported. Returns the primary language for the locale.
Not supported. Returns the region for the locale.
Not supported. Returns the script for the locale.
Not supported. Returns the closest language tag for the locale.
Not supported. Returns an associative array of locale identifier subtags.
Not supported. Sets the default runtime locale.
Details
static string
acceptFromHttp(string $header)
Not supported. Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616.
static string
canonicalize(string $locale)
Returns a canonicalized locale string.
This polyfill doesn't implement the full-spec algorithm. It only
canonicalizes locale strings handled by the LocaleBundle
class.
static string
composeLocale(array $subtags)
Not supported. Returns a correctly ordered and delimited locale code.
static string
filterMatches(string $langtag, string $locale, bool $canonicalize = false)
Not supported. Checks if a language tag filter matches with locale.
static array
getAllVariants(string $locale)
Not supported. Returns the variants for the input locale.
static string
getDisplayLanguage(string $locale, string $inLocale = null)
Not supported. Returns the localized display name for the locale language.
static string
getDisplayName(string $locale, string $inLocale = null)
Not supported. Returns the localized display name for the locale.
static string
getDisplayRegion(string $locale, string $inLocale = null)
Not supported. Returns the localized display name for the locale region.
static string
getDisplayScript(string $locale, string $inLocale = null)
Not supported. Returns the localized display name for the locale script.
static string
getDisplayVariant(string $locale, string $inLocale = null)
Not supported. Returns the localized display name for the locale variant.
static string|null
getPrimaryLanguage(string $locale)
Not supported. Returns the primary language for the locale.
static
lookup(array $langtag, string $locale, bool $canonicalize = false, string $default = null)
Not supported. Returns the closest language tag for the locale.