ICanBoogie/I18n 2.0.x
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Binding
      • I18n
    • I18n
      • Translator

Classes

  • FormattedString
  • Helpers
  • Hooks
  • Translator

Functions

  • date_period
  • format_currency
  • format_date
  • format_datetime
  • format_number
  • format_size
  • format_time
  • get_cldr
  • get_language
  • get_locale
  • t

Class Translator

ICanBoogie\I18n\Translator implements ArrayAccess uses ICanBoogie\PrototypeTrait (not available)
Namespace: ICanBoogie\I18n
Located at Translator.php

Methods summary

public static ICanBoogie\I18n\Translator
# from( 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 $options = [] )

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
# []
ICanBoogie/I18n 2.0.x API documentation generated by ApiGen