Symfony\Component\Locale\Locale
Helper class for dealing with locale strings.
- Author: Bernhard Schussek <bschussek@gmail.com>
Synopsis
class Locale
extends Locale
{
- // Inherited constants from Locale
- const DEFAULT_LOCALE = ;
- const ACTUAL_LOCALE = 0;
- const VALID_LOCALE = 1;
- const LANG_TAG = 'language';
- const EXTLANG_TAG = 'extlang';
- const SCRIPT_TAG = 'script';
- const REGION_TAG = 'region';
- const VARIANT_TAG = 'variant';
- const GRANDFATHERED_LANG_TAG = 'grandfathered';
- const PRIVATE_TAG = 'private';
- // members
- protected array $countries;
- protected array $languages;
- protected array $locales;
- // methods
- public static array getDisplayCountries()
- public static array getCountries()
- public static array getDisplayLanguages()
- public static array getLanguages()
- public static array getDisplayLocales()
- public static array getLocales()
- public static string|null getIntlIcuVersion()
- public static string|null getIntlIcuDataVersion()
- public static string getIcuDataVersion()
- public static string getIcuDataDirectory()
- protected static string|null getFallbackLocale()
- // Inherited methods from Locale
- public static string acceptFromHttp()
- public static string composeLocale()
- public static string filterMatches()
- public static array getAllVariants()
- public static string getDefault()
- public static string getDisplayLanguage()
- public static string getDisplayName()
- public static string getDisplayRegion()
- public static string getDisplayScript()
- public static string getDisplayVariant()
- public static array getKeywords()
- public static string|null getPrimaryLanguage()
- public static string|null getRegion()
- public static string|null getScript()
- public static void lookup()
- public static array parseLocale()
- public static Boolean setDefault()
Hierarchy
Extends
Constants
Name | Value |
---|---|
DEFAULT_LOCALE | |
ACTUAL_LOCALE | 0 |
VALID_LOCALE | 1 |
LANG_TAG | 'language' |
EXTLANG_TAG | 'extlang' |
SCRIPT_TAG | 'script' |
REGION_TAG | 'region' |
VARIANT_TAG | 'variant' |
GRANDFATHERED_LANG_TAG | 'grandfathered' |
PRIVATE_TAG | 'private' |
Members
protected
- $countries
—
array
Caches the countries in different locales - $languages
—
array
Caches the languages in different locales - $locales
—
array
Caches the different locales
Methods
protected
- getFallbackLocale() — Returns the fallback locale for a given locale, if any
public
- getCountries() — Returns all available country codes
- getDisplayCountries() — Returns the country names for a locale
- getDisplayLanguages() — Returns the language names for a locale
- getDisplayLocales() — Returns the locale names for a locale
- getIcuDataDirectory() — Returns the directory path of the ICU data that ships with Symfony
- getIcuDataVersion() — Returns the ICU data version that ships with Symfony. If the environment variable USE_INTL_ICU_DATA_VERSION is defined, it will try use the ICU data version as defined by the intl extension, if available.
- getIntlIcuDataVersion() — Returns the ICU Data version as defined by the intl extension
- getIntlIcuVersion() — Returns the ICU version as defined by the intl extension
- getLanguages() — Returns all available language codes
- getLocales() — Returns all available locale codes
Inherited from Symfony\Component\Intl\Locale\Locale
public
- acceptFromHttp() — Not supported. Returns the best available locale based on HTTP "Accept-Language" header according to RFC 2616
- composeLocale() — Not supported. Returns a correctly ordered and delimited locale code
- filterMatches() — Not supported. Checks if a language tag filter matches with locale
- getAllVariants() — Not supported. Returns the variants for the input locale
- getDefault() — Returns the default locale
- getDisplayLanguage() — Not supported. Returns the localized display name for the locale language
- getDisplayName() — Not supported. Returns the localized display name for the locale
- getDisplayRegion() — Not supported. Returns the localized display name for the locale region
- getDisplayScript() — Not supported. Returns the localized display name for the locale script
- getDisplayVariant() — Not supported. Returns the localized display name for the locale variant
- getKeywords() — Not supported. Returns the keywords for the locale
- getPrimaryLanguage() — Not supported. Returns the primary language for the locale
- getRegion() — Not supported. Returns the region for the locale
- getScript() — Not supported. Returns the script for the locale
- lookup() — Not supported. Returns the closest language tag for the locale
- parseLocale() — Not supported. Returns an associative array of locale identifier subtags
- setDefault() — Not supported. Sets the default runtime locale