class IcuResFileLoader implements LoaderInterface

IcuResFileLoader loads translations from a resource bundle.

Methods

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

Loads a locale.

array
flatten(ResourceBundle $rb, array $messages = array(), string $path = null)

Flattens an ResourceBundle.

Details

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

Loads a locale.

Parameters

mixed $resource A resource
string $locale A locale
string $domain The domain

Return Value

MessageCatalogue A MessageCatalogue instance

Exceptions

NotFoundResourceException when the resource cannot be found
InvalidResourceException when the resource cannot be loaded

at line 78
protected array flatten(ResourceBundle $rb, array $messages = array(), string $path = null)

Flattens an ResourceBundle.

The scheme used is: key { key2 { key3 { "value" } } } Becomes: 'key.key2.key3' => 'value'

This function takes an array by reference and will modify it

Parameters

ResourceBundle $rb The ResourceBundle that will be flattened
array $messages Used internally for recursive calls
string $path Current path being parsed, used internally for recursive calls

Return Value

array the flattened ResourceBundle