Class IcuFormatter
A formatter that will interpolate variables using the MessageFormatter class
- Cake\I18n\Formatter\IcuFormatter implements Aura\Intl\FormatterInterface
Method Summary
-
_formatMessage() protected
Does the actual formatting using the MessageFormatter class -
format() public
Returns a string with all passed variables interpolated into the original message. Variables are interpolated using the MessageFormatter class.
Method Detail
_formatMessage() protected ¶
_formatMessage( string $locale , string|array $message , array $vars )
Does the actual formatting using the MessageFormatter class
Parameters
- string $locale
- The locale in which the message is presented.
- string|array $message
- The message to be translated
- array $vars
- The list of values to interpolate in the message
Returns
string
The formatted message
The formatted message
Throws
Aura\Intl\Exception\CannotInstantiateFormatter
Aura\Intl\Exception\CannotFormat
if any error occurred while parsing the message
Aura\Intl\Exception\CannotFormat
If any error related to the passed variables is found
format() public ¶
format( string $locale , string|array $message , array $vars )
Returns a string with all passed variables interpolated into the original message. Variables are interpolated using the MessageFormatter class.
Parameters
- string $locale
- The locale in which the message is presented.
- string|array $message
- The message to be translated
- array $vars
- The list of values to interpolate in the message
Returns
string
The formatted message
The formatted message
Throws
Aura\Intl\Exception\CannotFormat
Aura\Intl\Exception\CannotInstantiateFormatter
Aura\Intl\Exception\CannotInstantiateFormatter