__(string $singular, mixed ...$args): string
Returns a translated string if one is found; Otherwise, the submitted message.
string
$singular
Text to translate.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__d(string $domain, string $msg, mixed ...$args): string
Allows you to override the current domain for a single message lookup.
string
$domain
Domain.
string
$msg
String to translate.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__dn(string $domain, string $singular, string $plural, int $count, mixed ...$args): string
Allows you to override the current domain for a single plural message lookup. Returns correct plural form of message identified by $singular and $plural for count $count from domain $domain.
string
$domain
Domain.
string
$singular
Singular string to translate.
string
$plural
Plural.
int
$count
Count.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__dx(string $domain, string $context, string $msg, mixed ...$args): string
Allows you to override the current domain for a single message lookup. The context is a unique identifier for the translations string that makes it unique within the same domain.
string
$domain
Domain.
string
$context
Context of the text.
string
$msg
String to translate.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__dxn(string $domain, string $context, string $singular, string $plural, int $count, mixed ...$args): string
Returns correct plural form of message identified by $singular and $plural for count $count. Allows you to override the current domain for a single message lookup. The context is a unique identifier for the translations string that makes it unique within the same domain.
string
$domain
Domain.
string
$context
Context of the text.
string
$singular
Singular text to translate.
string
$plural
Plural text.
int
$count
Count.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__n(string $singular, string $plural, int $count, mixed ...$args): string
Returns correct plural form of message identified by $singular and $plural for count $count. Some languages have more than one form for plural messages dependent on the count.
string
$singular
Singular text to translate.
string
$plural
Plural text.
int
$count
Count.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__x(string $context, string $singular, mixed ...$args): string
Returns a translated string if one is found; Otherwise, the submitted message. The context is a unique identifier for the translations string that makes it unique within the same domain.
string
$context
Context of the text.
string
$singular
Text to translate.
mixed
...$args
Array with arguments or multiple arguments in function.
string
__xn(string $context, string $singular, string $plural, int $count, mixed ...$args): string
Returns correct plural form of message identified by $singular and $plural for count $count. Some languages have more than one form for plural messages dependent on the count. The context is a unique identifier for the translations string that makes it unique within the same domain.
string
$context
Context of the text.
string
$singular
Singular text to translate.
string
$plural
Plural text.
int
$count
Count.
mixed
...$args
Array with arguments or multiple arguments in function.
string
toDate(mixed $value, string $format = 'Y-m-d'): Cake\I18n\Date|null
Converts a value to a Date object.
integer - value is treated as a Unix timestamp float - value is treated as a Unix timestamp with microseconds string - value is treated as a I18N short formatted date, unless otherwise specified Other values returns as null.
mixed
$value
The value to convert to Date.
string
$format
optional
The date format the value is in. Defaults to Short (ex: 1970-01-01) format.
Cake\I18n\Date|null
toDateTime(mixed $value, string $format = DateTimeInterface::ATOM): Cake\I18n\DateTime|null
Converts a value to a DateTime object.
integer - value is treated as a Unix timestamp float - value is treated as a Unix timestamp with microseconds string - value is treated as an Atom-formatted timestamp, unless otherwise specified Other values returns as null.
mixed
$value
The value to convert to DateTime.
string
$format
optional
The datetime format the value is in. Defaults to Atom (ex: 1970-01-01T12:00:00+00:00) format.
Cake\I18n\DateTime|null
Formatter Interface
Wraps multiple message loaders calling them one after another until one of them returns a non-empty package.
Extends the Date class provided by Chronos.
Extends the built-in DateTime class to provide handy methods and locale-aware formatting helpers.
A ServiceLocator implementation for loading and retaining formatter objects.
I18n handles translation of Text and time format strings.
A generic translations package factory that will load translations files based on the file extension and the package name.
Number helper library.
Message Catalog
A ServiceLocator implementation for loading and retaining package objects.
Utility class used to determine the plural number to be used for a variable base on the locale.
Helper class for formatting relative dates & times.
Extends time class provided by Chronos.
Translator to translate the message.
Constructs and stores instances of translators that can be retrieved by name and locale.