MessageFormatter
in package
implements
MessageFormatterInterface, IntlFormatterInterface, ChoiceMessageFormatterInterface
Tags
Interfaces, Classes, Traits and Enums
- MessageFormatterInterface
- IntlFormatterInterface
- Formats ICU message patterns.
- ChoiceMessageFormatterInterface
Table of Contents
- $intlFormatter : mixed
- $translator : mixed
- __construct() : mixed
- choiceFormat() : string
- Formats a localized message pattern with given arguments.
- format() : string
- Formats a localized message pattern with given arguments.
- formatIntl() : string
- Formats a localized message using rules defined by ICU MessageFormat.
Properties
$intlFormatter
private
mixed
$intlFormatter
$translator
private
mixed
$translator
Methods
__construct()
public
__construct([TranslatorInterface|null $translator = null ][, IntlFormatterInterface $intlFormatter = null ]) : mixed
Parameters
- $translator : TranslatorInterface|null = null
-
An identity translator to use as selector for pluralization
- $intlFormatter : IntlFormatterInterface = null
Return values
mixed —choiceFormat()
Formats a localized message pattern with given arguments.
public
choiceFormat(mixed $message, mixed $number, mixed $locale[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $message : mixed
-
The message (may also be an object that can be cast to string)
- $number : mixed
-
The number to use to find the indice of the message
- $locale : mixed
-
The message locale
- $parameters : array<string|int, mixed> = []
-
An array of parameters for the message
Tags
Return values
string —format()
Formats a localized message pattern with given arguments.
public
format(mixed $message, mixed $locale[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $message : mixed
-
The message (may also be an object that can be cast to string)
- $locale : mixed
-
The message locale
- $parameters : array<string|int, mixed> = []
-
An array of parameters for the message
Return values
string —formatIntl()
Formats a localized message using rules defined by ICU MessageFormat.
public
formatIntl(string $message, string $locale[, array<string|int, mixed> $parameters = [] ]) : string
Parameters
- $message : string
- $locale : string
- $parameters : array<string|int, mixed> = []