Back to index

php5  5.3.10
Classes | Functions
locale_api.php File Reference

Go to the source code of this file.

Classes

class  Locale
 A "Locale" is an identifier used to get language, culture, or regionally-specific behavior from an API. More...

Functions

 locale_get_default ()
 Gets the default locale value from the INTL global 'default_locale' At the PHP initilaization (MINIT) this value is set to 'intl.default_locale' value from php.ini if that value exists or from ICU's function uloc_getDefault() Then onwards picks up changes from setDefault() calls also.
 locale_set_default ($locale)
 sets the default runtime locale to $locale This changes the value of INTL global 'default_locale'
 locale_get_primary_language ($locale)
 Gets the primary language for the input locale.
 locale_get_script ($locale)
 Gets the script for the input locale.
 locale_get_region ($locale)
 Gets the region for the input locale.
 locale_get_all_variants ($locale)
 Gets the variants for the input locale.
 locale_get_keywords ($locale)
 Gets the keywords for the input locale.
 locale_get_display_name ($locale, $in_locale=null)
 Returns an appropriately localized display name for the input locale.
 locale_get_display_language ($lang, $in_locale=null)
 Returns an appropriately localized display name for language of the input locale.
 locale_get_display_script ($script, $in_locale=null)
 Returns an appropriately localized display name for script of the input locale.
 locale_get_display_region ($region, $in_locale=null)
 Returns an appropriately localized display name for region of the input locale.
 locale_get_display_variant ($variant, $in_locale=null)
 Returns an appropriately localized display name for variants of the input locale.
 locale_filter_matches ($langtag, $locale, $canonicalize)
 Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm.
 locale_lookup (array $langtag, $locale, $default=null)
 Searchs the items in $langtag for the best match to the language range specified in $locale according to RFC 4647's lookup algorithm.
 locale_compose_locale (array $subtags)
 Returns a correctly ordered and delimited locale ID.
 locale_parse_locale ($locale)
 Returns a key-value array of locale ID subtag elements.

Function Documentation

locale_compose_locale ( array $  subtags)

Returns a correctly ordered and delimited locale ID.

Parameters:
array$subtagsan array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values.
Returns:
string the corresponding locale identifier.

Definition at line 420 of file locale_api.php.

{}
locale_filter_matches ( langtag,
locale,
canonicalize 
)

Checks if a $langtag filter matches with $locale according to RFC 4647's basic filtering algorithm.

Parameters:
string$langtagthe language tag to check
string$localethe language range to check against
bool$canonicalizeCanonicalize parameters?
Returns:
boolean 'true' if $locale matches $langtag 'false' otherwise

Definition at line 395 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_all_variants ( locale)

Gets the variants for the input locale.

Parameters:
string$localethe locale to extract the variants from
Returns:
array the array containing the list of all variants subtag for the locale or null if not present

Definition at line 315 of file locale_api.php.

{}

Here is the caller graph for this function:

Gets the default locale value from the INTL global 'default_locale' At the PHP initilaization (MINIT) this value is set to 'intl.default_locale' value from php.ini if that value exists or from ICU's function uloc_getDefault() Then onwards picks up changes from setDefault() calls also.

Returns:
string the current runtime locale

Definition at line 267 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_display_language ( lang,
in_locale = null 
)

Returns an appropriately localized display name for language of the input locale.

Parameters:
string$localethe locale to return a display language for
[string]$in_locale optional format locale to use to display the language name If is 'null' then the default locale is used.
Returns:
string display name of the language for the $locale in the format appropriate for $in_locale.

Definition at line 348 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_display_name ( locale,
in_locale = null 
)

Returns an appropriately localized display name for the input locale.

Parameters:
string$localethe locale to return a displayname for
[string]$in_locale optional format locale If is 'null' then the default locale is used.
Returns:
string display name of the locale in the format appropriate for $in_locale.

Definition at line 336 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_display_region ( region,
in_locale = null 
)

Returns an appropriately localized display name for region of the input locale.

Parameters:
string$localethe locale to return a display region for
[string]$in_locale optional format locale to use to display the region name If is 'null' then the default locale is used.
Returns:
string display name of the region for the $locale in the format appropriate for $in_locale.

Definition at line 371 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_display_script ( script,
in_locale = null 
)

Returns an appropriately localized display name for script of the input locale.

Parameters:
string$localethe locale to return a display script for
[string]$in_locale optional format locale to use to display the script name If is 'null' then the default locale is used.
Returns:
string display name of the script for the $locale in the format appropriate for $in_locale.

Definition at line 359 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_display_variant ( variant,
in_locale = null 
)

Returns an appropriately localized display name for variants of the input locale.

Parameters:
string$localethe locale to return a display variant for
[string]$in_locale optional format locale to use to display the variant name If is 'null' then the default locale is used.
Returns:
string display name of the variant for the $locale in the format appropriate for $in_locale.

Definition at line 383 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_keywords ( locale)

Gets the keywords for the input locale.

Parameters:
string$localethe locale to extract the keywords from
Returns:
array associative array containing the keyword-value pairs for this locale

Definition at line 324 of file locale_api.php.

{}

Here is the caller graph for this function:

Gets the primary language for the input locale.

Parameters:
string$localethe locale to extract the primary language code from
Returns:
string the language code associated with the language or null in case of error.

Definition at line 287 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_region ( locale)

Gets the region for the input locale.

Parameters:
string$localethe locale to extract the region code from
Returns:
string the region subtag for the locale or null if not present

Definition at line 305 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_get_script ( locale)

Gets the script for the input locale.

Parameters:
string$localethe locale to extract the script code from
Returns:
string the script subtag for the locale or null if not present

Definition at line 296 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_lookup ( array $  langtag,
locale,
default = null 
)

Searchs the items in $langtag for the best match to the language range specified in $locale according to RFC 4647's lookup algorithm.

Parameters:
array$langtagan array containing a list of language tags to compare to $locale
string$localethe locale to use as the language range when matching
string$defaultthe locale to use if no match is found
Returns:
string closest matching language tag, $default, or empty string

Definition at line 408 of file locale_api.php.

{}

Here is the caller graph for this function:

locale_parse_locale ( locale)

Returns a key-value array of locale ID subtag elements.

Parameters:
string$localethe locale to extract the subtag array from
Returns:
array $subtags an array containing a list of key-value pairs, where the keys identify the particular locale ID subtags, and the values are the associated subtag values.

Definition at line 432 of file locale_api.php.

{}
locale_set_default ( locale)

sets the default runtime locale to $locale This changes the value of INTL global 'default_locale'

Parameters:
string$localeis a BCP 47 compliant language tag containing the locale identifier. UAX #35 extensions are accepted.
Returns:
boolean 'true' if okay, 'false' if an error

Definition at line 277 of file locale_api.php.

{}

Here is the caller graph for this function: