Final Class Yiisoft\Translator\Formatter\Intl\IntlMessageFormatter
| Inheritance | Yiisoft\ |
|---|---|
| Implements | Yiisoft\ |
Public Methods
| Method | Description | Defined By |
|---|---|---|
| format() | This method uses \ |
Yiisoft\ |
Method Details
This method uses \
| public string format ( string $message, array $parameters, string $locale ) | ||
| $message | string | |
| $parameters | array | |
| $locale | string | |
public function format(string $message, array $parameters, string $locale): string
{
if ($parameters === []) {
return $message;
}
$formatter = new MessageFormatter($locale, $message);
$result = $formatter->format($parameters);
if ($result === false) {
return $message;
}
return $result;
}
User Contributed Notes
Leave a comment
Join the conversation to share a note.