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 Translator

ICanBoogie\Object
Extended by ICanBoogie\I18n\Translator implements ArrayAccess
Namespace: ICanBoogie\I18n
Located at translator.php

Methods summary

public static ICanBoogie\I18n\Translator
# get( string $id )

Return the translator for the specified locale.

Return the translator for the specified locale.

Parameters

$id
The locale identifier.

Returns

ICanBoogie\I18n\Translator
The translator for the locale.
protected static
# get_cache( )
public static
# messages_construct( $id )
protected
# lazy_get_messages( )
protected ICanBoogie\I18n\Translator|null
# lazy_get_fallback( )

Returns a translator fallback for this translator.

Returns a translator fallback for this translator.

Returns

ICanBoogie\I18n\Translator|null

The translator fallback for this translator or null if there is none.

protected
# __construct( string $id )

Constructor.

Constructor.

Parameters

$id
Locale identifier
public string
# __invoke( string $native, array $args = array(), array $options = array() )

Translate a native string in a locale string.

Translate a native string in a locale string.

Parameters

$native
The native string to translate.
$args
$options

Returns

string

The translated string, or the same native string if no translation could be found.

public
# offsetExists( $offset )

Implementation of

ArrayAccess::offsetExists()
public
# offsetGet( $offset )

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( $offset, $value )

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( $offset )

Implementation of

ArrayAccess::offsetUnset()

Properties summary

protected static $cache
#
protected array $messages

Translation messages.

Translation messages.

#
protected ICanBoogie\I18n\Translator $fallback

Fallback translator.

Fallback translator.

#
protected string $id

Locale id for this translator.

Locale id for this translator.

#
public static array $missing
# array()
ICanBoogie/I18n master API documentation generated by ApiGen