Locale
class Locale (View source)
Constants
ACTUAL_LOCALE |
This is locale the data actually comes from. |
VALID_LOCALE |
This is the most specific locale supported by ICU. |
DEFAULT_LOCALE |
Used as locale parameter with the methods of the various locale affected classes,
such as NumberFormatter. This constant would make the methods to use default
locale. |
LANG_TAG |
Language subtag |
EXTLANG_TAG |
Extended language subtag |
SCRIPT_TAG |
Script subtag |
REGION_TAG |
Region subtag |
VARIANT_TAG |
Variant subtag |
GRANDFATHERED_LANG_TAG |
Grandfathered Language subtag |
PRIVATE_TAG |
Private subtag |
Methods
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the default locale value from the INTL global 'default_locale'
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
sets the default runtime locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the primary language for the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the script for the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the region for the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the keywords for the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for script of the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for region of the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for language of the inputlocale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for variants of the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns a correctly ordered and delimited locale ID
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns a key-value array of locale ID subtag elements.
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the variants for the input locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Checks if a language tag filter matches with locale
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Searches the language tag list for the best match to the language
No description
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Tries to find out best available locale based on HTTP "Accept-Language" header
Details
static string
getDefault()
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the default locale value from the INTL global 'default_locale'
static bool
setDefault(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
sets the default runtime locale
static string|null
getPrimaryLanguage(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the primary language for the input locale
static string|null
getScript(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the script for the input locale
static string|null
getRegion(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the region for the input locale
static array|false|null
getKeywords(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the keywords for the input locale
static string|false
getDisplayScript(string $locale, string $displayLocale = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for script of the input locale
static string|false
getDisplayRegion(string $locale, string $displayLocale = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for region of the input locale
static string|false
getDisplayName(string $locale, string $displayLocale = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for the input locale
static string|false
getDisplayLanguage(string $locale, string $displayLocale = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for language of the inputlocale
static string|false
getDisplayVariant(string $locale, string $displayLocale = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns an appropriately localized display name for variants of the input locale
static string|false
composeLocale(array $subtags)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns a correctly ordered and delimited locale ID
static array|null
parseLocale(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Returns a key-value array of locale ID subtag elements.
static array|null
getAllVariants(string $locale)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Gets the variants for the input locale
static bool|null
filterMatches(string $languageTag, string $locale, bool $canonicalize = false)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Checks if a language tag filter matches with locale
static string|null
lookup(array $languageTag, string $locale, bool $canonicalize = false, string $defaultLocale = null)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Searches the language tag list for the best match to the language
static string|null
canonicalize(string $locale)
No description
static string|false
acceptFromHttp(string $header)
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
Tries to find out best available locale based on HTTP "Accept-Language" header