YamlWriter
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).
Properties
protected | Dumper | $dumper |
Methods
Explodes [class.key1 => value1, class.key2 => value2] into [class => [ key1 => value1, key2 => value2]]
Convert entities array format into yml-ready string / array
Details
protected Dumper
getDumper()
No description
write(array $messages, string $locale, string $path)
No description
protected array
denormaliseMessages(array $messages)
Explodes [class.key1 => value1, class.key2 => value2] into [class => [ key1 => value1, key2 => value2]]
Inverse of YamlReader::normaliseMessages()
protected array|string
denormaliseValue(array|string $value)
Convert entities array format into yml-ready string / array
protected array
getPluralForm(array|string $value)
Get array-plural form for any value
string
getYaml(array $messages, string $locale)
Convert messages to yml ready to write
protected array
getClassKey(string $entity)
Determine class and key for a localisation entity