This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Translation/Loader/ArrayLoader.php

34 lines
766 B
PHP
Raw Normal View History

2010-09-27 08:45:29 +01:00
<?php
namespace Symfony\Component\Translation\Loader;
use Symfony\Component\Translation\MessageCatalogue;
/*
* This file is part of the Symfony framework.
*
* (c) Fabien Potencier <fabien.potencier@symfony-project.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
/**
* ArrayLoader loads translations from a PHP array.
*
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
*/
class ArrayLoader implements LoaderInterface
{
/**
* {@inheritdoc}
*/
function load($resource, $locale, $domain = 'messages')
{
$catalogue = new MessageCatalogue($locale);
$catalogue->addMessages($resource, $domain);
return $catalogue;
}
}