ICanBoogie
  • Documentation
  • API Reference
  • I18n 1.0.x
Namespaces
  • ICanBoogie
    • I18n
      • Translator
Classes
  • FormattedString
  • Helpers
  • Locale
  • NumberFormatter
  • Translator
Functions
  • date_period
  • format_currency
  • format_date
  • format_datetime
  • format_number
  • format_size
  • format_time
  • get_cldr
  • get_language
  • get_locale
  • set_locale
  • t

Class Locale

A locale refers to a set of user preferences that tend to be shared across significant swaths of the world. Traditionally, the data associated with it provides support for formatting and parsing of dates, times, numbers, and currencies; for measurement units, for sort-order (collation), plus translated names for time zones, languages, countries, and scripts. The data can also include support for text boundaries (character, word, line, and sentence), text transformations (including transliterations), and other services.

ICanBoogie\CLDR\Locale
┗ ICanBoogie\I18n\Locale
Namespace: ICanBoogie\I18n
Located at locale.php

Methods summary

public static from( string $id ) : Locale.

Returns the locale for the specified id.

Returns the locale for the specified id.

Parameters

$id
The locale id.

Returns

Locale.
public __construct( ICanBoogie\CLDR\Repository $repository, $id )

Initializes the ICanBoogie\I18n\Locale::$language and ICanBoogie\I18n\Locale::$territory properties.

Initializes the ICanBoogie\I18n\Locale::$language and ICanBoogie\I18n\Locale::$territory properties.

Parameters

$repository
$id Locale identifier.
$id
public __get( $property )
public __call( $method, $arguments )
public __toString( void ) : string

Returns the locale identifier.

Returns the locale identifier.

Returns

string
protected get_calendar( void ) : array

Returns the data of the default calendar for the locale.

Returns the data of the default calendar for the locale.

Returns

array
protected get_number_formatter( void ) : ICanBoogie\I18n\NumberFormatter

Returns the number formatter for the locale.

Returns the number formatter for the locale.

Returns

ICanBoogie\I18n\NumberFormatter
protected get_translator( void ) : ICanBoogie\I18n\Translator

Returns the string translator for the locale.

Returns the string translator for the locale.

Returns

ICanBoogie\I18n\Translator

Properties summary

protected $id : string

Language identifier.

Language identifier.


		
protected $language : string

Language of the locale.

Language of the locale.


		
protected $territory : string

Territory code for this locale.

Territory code for this locale.


		

Magic properties

public read-only $id : string

Locale id

public read-only $language : string

Language of the locale.

public read-only $territory : string

Territory of the locale.

public read-only $calendar : array

The data of the default calendar for the locale.

public read-only $conventions : Conventions

The UNICODE conventions for the locale.

public read-only $date_formatter : DateFormatter

The data formatter for the locale.

public read-only $number_formatter : ICanBoogie\I18n\NumberFormatter

The number formatter for the locale.

public read-only $translator : ICanBoogie\I18n\Translator

The translator for the locale.

I18n 1.0.x – Check on GitHub – API documentation generated by ApiGen