Interface Yiisoft\Translator\MessageReaderInterface
| Implemented by | Yiisoft\Translator\IdMessageReader, Yiisoft\Translator\InMemoryMessageSource |
|---|
Reader obtains a translated message for a given locale by ID and category. Parameters may be used to decide about the message to obtain as well.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| getMessage() | Obtains a translation message. | Yiisoft\Translator\MessageReaderInterface |
| getMessages() | Yiisoft\Translator\MessageReaderInterface |
Method Details
Obtains a translation message.
| public abstract string|null getMessage ( string $id, string $category, string $locale, array $parameters = [] ) | ||
| $id | string |
ID of the message to get. |
| $category | string |
Category of the message to get. |
| $locale | string |
Locale of the message to get. |
| $parameters | array |
Parameters that may be used to decide about the message to obtain. |
| return | string|null |
The translated message or null if translation wasn't found. |
|---|---|---|
public function getMessage(string $id, string $category, string $locale, array $parameters = []): ?string;
| public abstract array getMessages ( string $category, string $locale ) | ||
| $category | string |
Category of messages to get. |
| $locale | string |
Locale of messages to get. |
| return | array |
All messages from category. The format is the following:
|
|---|---|---|
public function getMessages(string $category, string $locale): array;
Signup or Login in order to comment.