class Locale extends Locale

Provides access to locale-related data.

Methods

static 
setDefaultFallback(string $locale)

Sets the default fallback locale.

static string
getDefaultFallback()

Returns the default fallback locale.

static string|null
getFallback(string $locale)

Returns the fallback locale for a given locale.

Details

at line line 38
static setDefaultFallback(string $locale)

Sets the default fallback locale.

The default fallback locale is used as fallback for locales that have no fallback otherwise.

Parameters

string $locale The default fallback locale

See also

getFallback()

at line line 51
static string getDefaultFallback()

Returns the default fallback locale.

Return Value

string The default fallback locale

See also

setDefaultFallback()
getFallback()

at line line 68
static string|null getFallback(string $locale)

Returns the fallback locale for a given locale.

For example, the fallback of "fr_FR" is "fr". The fallback of "fr" is the default fallback locale configured with {@link setDefaultFallback()}. The default fallback locale has no fallback.

Parameters

string $locale The ICU locale code to find the fallback for

Return Value

string|null The ICU locale code of the fallback locale, or null if no fallback exists