class ModuleYamlLoader extends ArrayLoader (View source)

Loads yaml localisations across all modules simultaneously.

Note: This will also convert rails yml plurals into symfony standard format. Acts as a YamlFileLoader, but across a list of modules

Properties

protected Reader $reader

Message reader

Methods

public
MessageCatalogue
load(mixed $resource, string $locale, string $domain = 'messages')

No description

public
getReader()

No description

public
$this
setReader(Reader $reader)

No description

protected
array
loadMessages(string $path, string $locale)

Load messages

protected
array
normaliseMessages(array $messages, string $locale)

Normalises plurals in messages from rails-yaml format to symfony.

protected
string
normaliseMessage(string $key, mixed $value, string $locale)

Normalise rails-yaml plurals into pipe-separated rules

Details

MessageCatalogue load(mixed $resource, string $locale, string $domain = 'messages')

No description

Parameters

mixed $resource
string $locale
string $domain

Return Value

MessageCatalogue

Reader getReader()

No description

Return Value

Reader

$this setReader(Reader $reader)

No description

Parameters

Reader $reader

Return Value

$this

protected array loadMessages(string $path, string $locale)

Load messages

Parameters

string $path
string $locale

Return Value

array

protected array normaliseMessages(array $messages, string $locale)

Normalises plurals in messages from rails-yaml format to symfony.

Parameters

array $messages

List of messages

string $locale

Return Value

array

Normalised messages

protected string normaliseMessage(string $key, mixed $value, string $locale)

Normalise rails-yaml plurals into pipe-separated rules

Parameters

string $key
mixed $value

Input value

string $locale

Return Value

string