API / Minn\Support / Locale

Locale final class

Minn\Support\Locale · public/minn/src/Minn/Support/Locale.php · 31 lines

The locale's calendar and number vocabulary as data: the names a site prints for weekdays, months and meridiems, and how it separates thousands and decimals.

The names are English here because the engine carries no core translations yet; the facade runs each one through the translation filters on the way out, so a catalogue can answer for them later without this class changing.

Constants and properties

constWEEKDAYS = array ( 0 => 'Sunday', 1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', )
constMONTHS = array ( 0 => 'January', 1 => 'February', 2 => 'March', 3 => 'April', 4 => 'May', 5 => 'June', 6 => 'July', 7 => 'August', 8 => 'September', 9 => 'October', 10 => 'November', 11 => 'December', )
constMERIDIEM = array ( 'am' => 'am', 'pm' => 'pm', 'AM' => 'AM', 'PM' => 'PM', )
constNUMBER_FORMAT = array ( 'thousands_sep' => ',', 'decimal_point' => '.', )
constLIST_ITEM_SEPARATOR = ', '
constWORD_COUNT_TYPE = 'words'
constTEXT_DIRECTION = 'ltr'

Public

staticweekdayInitial(string $day): string#

A weekday's one-letter form.

staticabbreviation(string $name): string#

A weekday's or month's three-letter form; May is already three letters.

staticmonthKey(string|int $month): string#

Months are keyed by their zero-padded number, both ways round.