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
load($resource, $locale, $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

load($resource, $locale, $domain = 'messages')

No description

Parameters

$resource
$locale
$domain

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