ICanBoogie/I18n master
  • Namespace
  • Class

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
Extended by ICanBoogie\I18n\Locale
Namespace: ICanBoogie\I18n
Located at locale.php

Methods summary

public static Locale.
# from( string $id )

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. The underscore character "_" is replace with the hypen-minus character "-" as advised by the BCP 47.

$id
public
# __get( $property )
public
# __call( $method, $arguments )
public string
# __toString( )

Returns the locale identifier.

Returns the locale identifier.

Returns

string
protected array
# get_calendar( )

Returns the data of the default calendar for the locale.

Returns the data of the default calendar for the locale.

Returns

array
protected ICanBoogie\I18n\NumberFormatter
# get_number_formatter( )

Returns the number formatter for the locale.

Returns the number formatter for the locale.

Returns

ICanBoogie\I18n\NumberFormatter
protected ICanBoogie\I18n\Translator
# get_translator( )

Returns the string translator for the locale.

Returns the string translator for the locale.

Returns

ICanBoogie\I18n\Translator

Properties summary

protected string $id

Language identifier.

Language identifier.

#
protected string $language

Language of the locale.

Language of the locale.

#
protected string $territory

Territory code for this locale.

Territory code for this locale.

#

Magic properties

public read-only string $id

Locale id

public read-only string $language

Language of the locale.

public read-only string $territory

Territory of the locale.

public read-only array $calendar

The data of the default calendar for the locale.

public read-only Conventions $conventions

The UNICODE conventions for the locale.

public read-only DateFormatter $date_formatter

The data formatter for the locale.

public read-only ICanBoogie\I18n\NumberFormatter $number_formatter

The number formatter for the locale.

public read-only ICanBoogie\I18n\Translator $translator

The translator for the locale.

ICanBoogie/I18n master API documentation generated by ApiGen