Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

locale(3) [php man page]

LOCALE(3)								 1								 LOCALE(3)

The Locale class

INTRODUCTION
A "Locale" is an identifier used to get language, culture, or regionally-specific behavior from an API. PHP locales are organized and identified the same way that the CLDR locales used by ICU (and many vendors of Unix-like operating systems, the Mac, Java, and so forth) use. Locales are identified using RFC 4646 language tags (which use hyphen, not underscore) in addition to the more traditional underscore- using identifiers. Unless otherwise noted the functions in this class are tolerant of both formats. Examples of identifiers include: oen-US (English, United States) ozh-Hant-TW (Chinese, Traditional Script, Taiwan) ofr-CA, fr-FR (French for Canada and France respectively) The Locale class (and related procedural functions) are used to interact with locale identifiers--to verify that an ID is well-formed, valid, etc. The extensions used by CLDR in UAX #35 (and inherited by ICU) are valid and used wherever they would be in ICU normally. Locales cannot be instantiated as objects. All of the functions/methods provided are static. The null or empty string obtains the "root" locale. The "root" locale is equivalent to "en_US_POSIX" in CLDR. Language tags (and thus locale identifiers) are case insensitive. There exists a canonicalization function to make case match the specification. CLASS SYNOPSIS
Locale Locale Methods o publicstatic string Locale::acceptFromHttp (string $header) o publicstatic string Locale::canonicalize (string $locale) o publicstatic string Locale::composeLocale (array $subtags) o publicstatic bool Locale::filterMatches (string $langtag, string $locale, [bool $canonicalize = false]) o publicstatic array Locale::getAllVariants (string $locale) o publicstatic string Locale::getDefault (void ) o publicstatic string Locale::getDisplayLanguage (string $locale, [string $in_locale]) o publicstatic string Locale::getDisplayName (string $locale, [string $in_locale]) o publicstatic string Locale::getDisplayRegion (string $locale, [string $in_locale]) o publicstatic string Locale::getDisplayScript (string $locale, [string $in_locale]) o publicstatic string Locale::getDisplayVariant (string $locale, [string $in_locale]) o publicstatic array Locale::getKeywords (string $locale) o publicstatic string Locale::getPrimaryLanguage (string $locale) o publicstatic string Locale::getRegion (string $locale) o publicstatic string Locale::getScript (string $locale) o publicstatic string Locale::lookup (array $langtag, string $locale, [bool $canonicalize = false], [string $default]) o publicstatic array Locale::parseLocale (string $locale) o publicstatic bool Locale::setDefault (string $locale) PREDEFINED CONSTANTS
o Locale::DEFAULT_LOCALE ( null) - Used as locale parameter with the methods of the various locale affected classes, such as Number- Formatter. This constant would make the methods to use default locale. These constants describe the choice of the locale for getLocalte method of different classes. o Locale::ACTUAL_LOCALE ( string) -This is locale the data actually comes from. o Locale::VALID_LOCALE ( string) -This is the most specific locale supported by ICU. These constants define how the Locales are parsed or composed. They should be used as keys in the argument array to locale_compose(3) and are returned from locale_parse(3) as keys of the returned associative array. o Locale::LANG_TAG ( string) -Language subtag o Locale::EXTLANG_TAG ( string) -Extended language subtag o Locale::SCRIPT_TAG ( string) -Script subtag o Locale::REGION_TAG ( string) -Region subtag o Locale::VARIANT_TAG ( string) -Variant subtag o Locale::GRANDFATHERED_LANG_TAG ( string) -Grandfathered Language subtag o Locale::PRIVATE_TAG ( string) -Private subtag SEE ALSO
oRFC 4646 - Tags for Identifying Languages oRFC 4647 - Matching of Language Tags oUnicode CLDR Project:Common Locale Data Repository oIANA Language Subtags Registry oICU User Guide - Locale oICU Locale api PHP Documentation Group LOCALE(3)
Man Page