* * This source file is subject to the MIT license that is bundled * with this source code in the file LICENSE. */ /** * YamlFileLoader loads translations from Yaml files. * * @author Fabien Potencier */ class YamlFileLoader implements LoaderInterface { /** * {@inheritdoc} */ public function load($resource, $locale, $domain = 'messages') { $messages = Yaml::load($resource); $catalogue = new MessageCatalogue($locale); $catalogue->addMessages($messages, $domain); $catalogue->addResource(new FileResource($resource)); return $catalogue; } }