0 follower

Interface Yiisoft\Translator\MessageWriterInterface

Implemented byYiisoft\Translator\InMemoryMessageSource

Message writer writes a set of messages for a specified category and locale.

Public Methods

Hide inherited methods

Method Description Defined By
write() Writes a set of messages for a specified category and locale. Yiisoft\Translator\MessageWriterInterface

Method Details

Hide inherited methods

write() public abstract method

Writes a set of messages for a specified category and locale.

public abstract void write ( string $category, string $locale, array $messages )
$category string

Category to write messages for.

$locale string

Locale to write messages for.

$messages array

A set of messages to write. The format is the following:

[
  'key1' => [
    'message' => 'translation1',
    // Extra metadata that writer may use:
    'comment' => 'Translate carefully!',
  ],
  'key2' => [
    'message' => 'translation2',
    // Extra metadata that writer may use:
    'comment' => 'Translate carefully!',
  ],
]

                public function write(string $category, string $locale, array $messages): void;