ICanBoogie
  • Documentation
  • API Reference
  • CLDR master
Namespaces
  • ICanBoogie
    • CLDR
      • Plurals
      • Units
Classes
  • AbstractCollection
  • AbstractSectionCollection
  • Calendar
  • CalendarCollection
  • ContextTransforms
  • Currency
  • CurrencyCollection
  • CurrencyFormatter
  • DateFormatter
  • DateTimeAccessor
  • DateTimeFormatter
  • FileProvider
  • ListFormatter
  • Locale
  • LocaleCollection
  • LocalizedCurrency
  • LocalizedDateTime
  • LocalizedListFormatter
  • LocalizedLocale
  • LocalizedNumberFormatter
  • LocalizedObject
  • LocalizedObjectWithFormatter
  • LocalizedTerritory
  • Number
  • NumberFormatter
  • NumberPattern
  • NumberPatternParser
  • Numbers
  • Plurals
  • ProviderCollection
  • RedisProvider
  • Repository
  • RunTimeProvider
  • Supplemental
  • Territory
  • TerritoryCollection
  • TimeFormatter
  • Units
  • WebProvider
Interfaces
  • Exception
  • Formatter
  • LocalizeAwareInterface
  • Provider
Traits
  • CodePropertyTrait
  • CollectionTrait
  • LocalePropertyTrait
  • LocalizeTrait
  • ProviderStorageBinding
  • RepositoryPropertyTrait
Exceptions
  • ResourceNotFound
  • TerritoryNotDefined

Class Locale

Representation of a locale.

ICanBoogie\CLDR\AbstractSectionCollection implements ArrayAccess uses ICanBoogie\Accessor\AccessorTrait (not available) ICanBoogie\CLDR\CollectionTrait, ICanBoogie\CLDR\RepositoryPropertyTrait
┗ ICanBoogie\CLDR\Locale uses ICanBoogie\CLDR\CodePropertyTrait
Namespace: ICanBoogie\CLDR
Located at Locale.php

Methods summary

public __construct( ICanBoogie\CLDR\Repository $repository, string $code )

Initializes the $repository and $code properties.

Initializes the $repository and $code properties.

Parameters

$repository
$code
The ISO code of the locale.

Overrides

ICanBoogie\CLDR\AbstractSectionCollection::__construct
protected get_language( void ) : string

Returns

string
protected lazy_get_calendars( void ) : ICanBoogie\CLDR\CalendarCollection

Returns

ICanBoogie\CLDR\CalendarCollection
protected lazy_get_calendar( void ) : ICanBoogie\CLDR\Calendar

Returns

ICanBoogie\CLDR\Calendar
protected lazy_get_numbers( void ) : ICanBoogie\CLDR\Numbers

Returns

ICanBoogie\CLDR\Numbers
protected lazy_get_number_formatter( void ) : ICanBoogie\CLDR\LocalizedNumberFormatter

Returns

ICanBoogie\CLDR\LocalizedNumberFormatter
protected lazy_get_list_formatter( void ) : ICanBoogie\CLDR\LocalizedListFormatter

Returns

ICanBoogie\CLDR\LocalizedListFormatter
protected lazy_get_context_transforms( void ) : ICanBoogie\CLDR\ContextTransforms

Returns

ICanBoogie\CLDR\ContextTransforms
protected lazy_get_units( void ) : ICanBoogie\CLDR\Units

Returns

ICanBoogie\CLDR\Units
public localize( object|string $source_or_code, array $options = [] ) : mixed

Localize the specified source.

Localize the specified source.

Parameters

$source_or_code

The source to localize, or the locale code to localize this instance.

$options
The options are passed to the localizer.

Returns

mixed
public format_number( number $number, string|null $pattern = null, array $symbols = [] ) : string

Formats a number using $number_formatter.

Formats a number using $number_formatter.

Parameters

$number
$pattern
$symbols

Returns

string

See

LocalizedNumberFormatter::format
public format_list( array $list, array|string $list_patterns_or_type = LocalizedListFormatter::TYPE_STANDARD ) : string

Formats a variable-length lists of things using $list_formatter.

Formats a variable-length lists of things using $list_formatter.

Parameters

$list
The list to format.
$list_patterns_or_type

A list patterns or a list patterns type (one of LocalizedListFormatter::TYPE_*).

Returns

string
public context_transform( string $str, string $usage, string $type ) : string

Transforms a string depending on the context and the locale rules.

Transforms a string depending on the context and the locale rules.

Parameters

$str
$usage
One of ContextTransforms::USAGE_*
$type
One of ContextTransforms::TYPE_*

Returns

string

Methods inherited from ICanBoogie\CLDR\AbstractSectionCollection

offsetExists(), offsetGet()

Methods inherited from ArrayAccess

offsetSet(), offsetUnset()

Methods used from ICanBoogie\CLDR\CodePropertyTrait

__toString(), get_code()

Methods used from ICanBoogie\CLDR\CollectionTrait

offsetSet(), offsetUnset()

Methods used from ICanBoogie\CLDR\RepositoryPropertyTrait

get_repository()

Properties summary

protected $sections : array

Loaded sections.

Loaded sections.

[]

Magic properties

public read-only $repository : ICanBoogie\CLDR\Repository

The repository provided during construct.

public read-only $code : string

The ISO code of the locale.

public read-only $language : string

The language code.

public read-only $calendars : ICanBoogie\CLDR\CalendarCollection

The calendar collection of the locale.

public read-only $calendar : ICanBoogie\CLDR\Calendar

The preferred calendar for this locale.

public read-only $numbers : ICanBoogie\CLDR\Numbers
public read-only $number_formatter : ICanBoogie\CLDR\LocalizedNumberFormatter
public read-only $list_formatter : ICanBoogie\CLDR\LocalizedListFormatter
public read-only $context_transforms : ICanBoogie\CLDR\ContextTransforms
public read-only $units : ICanBoogie\CLDR\Units
CLDR master – Check on GitHub – API documentation generated by ApiGen