You are here

public function ArrayLoader::load in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/translation/Loader/ArrayLoader.php \Symfony\Component\Translation\Loader\ArrayLoader::load()

Loads a locale.

Parameters

mixed $resource A resource:

string $locale A locale:

string $domain The domain:

Return value

MessageCatalogue A MessageCatalogue instance

Throws

NotFoundResourceException when the resource cannot be found

InvalidResourceException when the resource cannot be loaded

Overrides LoaderInterface::load

7 calls to ArrayLoader::load()
CsvFileLoader::load in vendor/symfony/translation/Loader/CsvFileLoader.php
Loads a locale.
IniFileLoader::load in vendor/symfony/translation/Loader/IniFileLoader.php
Loads a locale.
JsonFileLoader::load in vendor/symfony/translation/Loader/JsonFileLoader.php
Loads a locale.
MoFileLoader::load in vendor/symfony/translation/Loader/MoFileLoader.php
Loads a locale.
PhpFileLoader::load in vendor/symfony/translation/Loader/PhpFileLoader.php
Loads a locale.

... See full list

7 methods override ArrayLoader::load()
CsvFileLoader::load in vendor/symfony/translation/Loader/CsvFileLoader.php
Loads a locale.
IniFileLoader::load in vendor/symfony/translation/Loader/IniFileLoader.php
Loads a locale.
JsonFileLoader::load in vendor/symfony/translation/Loader/JsonFileLoader.php
Loads a locale.
MoFileLoader::load in vendor/symfony/translation/Loader/MoFileLoader.php
Loads a locale.
PhpFileLoader::load in vendor/symfony/translation/Loader/PhpFileLoader.php
Loads a locale.

... See full list

File

vendor/symfony/translation/Loader/ArrayLoader.php, line 26

Class

ArrayLoader
ArrayLoader loads translations from a PHP array.

Namespace

Symfony\Component\Translation\Loader

Code

public function load($resource, $locale, $domain = 'messages') {
  $this
    ->flatten($resource);
  $catalogue = new MessageCatalogue($locale);
  $catalogue
    ->add($resource, $domain);
  return $catalogue;
}