class YamlWriter implements Writer (View source)

Write yml files compatible with ModuleYamlLoader

Note: YamlWriter may not correctly denormalise plural strings if writing outside of the default locale (en).

Methods

write(array $messages, string $locale, string $path)

No description

string
getYaml(array $messages, string $locale)

Convert messages to yml ready to write

Details

write(array $messages, string $locale, string $path)

Parameters

array $messages

Map of entity names (incl. namespace) to default values. Values may be array format for pluralised values, or strings for normal localisations.

string $locale
string $path

The directory base on which the collector should create new lang folders and files. Usually the webroot set through {@link Director::baseFolder()}. Can be overwritten for testing or export purposes.

string getYaml(array $messages, string $locale)

Convert messages to yml ready to write

Parameters

array $messages
string $locale

Return Value

string