Civil Date PHP Package

CustomLocale extends Locale
in package

FinalYes

Locale customized from another locale definition.

Tags
see
Locale::customizeFor()
LocaleBuilder::build()

Table of Contents

Properties

$languageTag  : string
Locale language tag containing a language and optional region.

Methods

__construct()  : mixed
Creates a custom locale that delegates to another locale.
abbreviatedDayOfWeekFromName()  : DayOfWeek|null
Parses a localized abbreviated day-of-week name.
abbreviatedDayOfWeekName()  : string
Formats an abbreviated day-of-week name.
abbreviatedEraFromName()  : Calendar|null
Parses a localized abbreviated era display name.
abbreviatedEraName()  : string
Formats an abbreviated era display name.
abbreviatedMonthFromName()  : int|null
Parses a localized abbreviated month name.
abbreviatedMonthName()  : string
Formats an abbreviated month name.
customizeFor()  : LocaleBuilder
Creates a locale builder for another language tag using this locale's behavior.
dayOfWeekFromName()  : DayOfWeek|null
Parses a localized day-of-week name.
dayOfWeekName()  : string
Formats a day-of-week name.
eraFromName()  : Calendar|null
Parses a localized era display name.
eraName()  : string
Formats an era display name.
isRightToLeft()  : bool
Returns whether formatted output uses right-to-left direction.
languageTag()  : string
Returns the locale language tag.
localize()  : string
Returns application-specific localized text for a custom key.
monthFromName()  : int|null
Parses a localized month name.
monthName()  : string
Formats a month name.
numberLocalizer()  : NumberLocalizer
Returns the number localizer used by this locale.
seasonFromName()  : Season|null
Parses a localized season name.
seasonName()  : string
Formats a season name.
textNormalizer()  : TextNormalizer
Returns the text normalizer used by this locale.

Properties

$languageTag read-only

Locale language tag containing a language and optional region.

protected string $languageTag

Methods

__construct()

Creates a custom locale that delegates to another locale.

public __construct(string $languageTag, Locale $locale[, array<int, string> $eraNames = [] ][, array<int, string> $abbreviatedEraNames = [] ][, array<int, array<int, string>> $monthNames = [] ][, array<int, array<int, string>> $abbreviatedMonthNames = [] ][, array<int, string> $dayOfWeekNames = [] ][, array<int, string> $abbreviatedDayOfWeekNames = [] ][, array<int, string> $seasonNames = [] ][, array<string, string> $localizations = [] ][, bool|null $rightToLeft = null ][, NumberLocalizer|null $numberLocalizer = null ][, TextNormalizer|null $textNormalizer = null ]) : mixed
Parameters
$languageTag : string

Language tag for the new locale.

$locale : Locale

Base locale whose behavior is delegated.

$eraNames : array<int, string> = []

Localized era name overrides.

$abbreviatedEraNames : array<int, string> = []

Localized abbreviated era name overrides.

$monthNames : array<int, array<int, string>> = []

Localized month name overrides.

$abbreviatedMonthNames : array<int, array<int, string>> = []

Localized abbreviated month name overrides.

$dayOfWeekNames : array<int, string> = []

Localized weekday name overrides.

$abbreviatedDayOfWeekNames : array<int, string> = []

Localized abbreviated weekday name overrides.

$seasonNames : array<int, string> = []

Localized season name overrides.

$localizations : array<string, string> = []

Application-specific localized text overrides.

$rightToLeft : bool|null = null

Whether output uses right-to-left direction, or null to use the base locale.

$numberLocalizer : NumberLocalizer|null = null

Number localizer to use, or null to use the base locale.

$textNormalizer : TextNormalizer|null = null

Text normalizer to use, or null to use the base locale.

Tags
see
LocaleBuilder::build()

abbreviatedDayOfWeekFromName()

Parses a localized abbreviated day-of-week name.

public abbreviatedDayOfWeekFromName(string $name) : DayOfWeek|null
Parameters
$name : string

Localized abbreviated day-of-week name.

Tags
see
CustomLocale::abbreviatedDayOfWeekName()
Return values
DayOfWeek|null

Matching day of week, or null when unrecognized.

abbreviatedEraFromName()

Parses a localized abbreviated era display name.

public abbreviatedEraFromName(string $name) : Calendar|null
Parameters
$name : string

Localized abbreviated era name.

Tags
see
CustomLocale::abbreviatedEraName()
Return values
Calendar|null

Matching calendar, or null when unrecognized.

abbreviatedMonthFromName()

Parses a localized abbreviated month name.

public abbreviatedMonthFromName(Calendar $calendar, string $name) : int|null
Parameters
$calendar : Calendar

Calendar identifier.

$name : string

Localized abbreviated month name.

Tags
see
CustomLocale::abbreviatedMonthName()
Return values
int|null

Matching month number, or null when unrecognized.

customizeFor()

Creates a locale builder for another language tag using this locale's behavior.

public customizeFor(string $languageTag) : LocaleBuilder

The custom locale inherits all behavior from this locale unless the builder overrides a specific value.

Parameters
$languageTag : string

Language tag for the customized locale.

Tags
see
LocaleBuilder::build()
CustomLocale
Return values
LocaleBuilder

Locale builder initialized from this locale.

eraFromName()

Parses a localized era display name.

public eraFromName(string $name) : Calendar|null
Parameters
$name : string

Localized era name.

Tags
see
CustomLocale::eraName()
Return values
Calendar|null

Matching calendar, or null when unrecognized.

isRightToLeft()

Returns whether formatted output uses right-to-left direction.

public isRightToLeft() : bool
Return values
bool

True for right-to-left output; false for left-to-right output.

languageTag()

Returns the locale language tag.

public languageTag() : string
Return values
string

Locale language tag.

localize()

Returns application-specific localized text for a custom key.

public localize(string $key) : string
Parameters
$key : string

Custom localization key.

Return values
string

Localized text, or base locale result when no override is defined.

monthFromName()

Parses a localized month name.

public monthFromName(Calendar $calendar, string $name) : int|null
Parameters
$calendar : Calendar

Calendar identifier.

$name : string

Localized month name.

Tags
see
CustomLocale::monthName()
Return values
int|null

Matching month number, or null when unrecognized.

seasonFromName()

Parses a localized season name.

public seasonFromName(string $name) : Season|null
Parameters
$name : string

Localized season name.

Tags
see
CustomLocale::seasonName()
Return values
Season|null

Matching season, or null when unrecognized.

On this page

Search results