4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Intl\ResourceBundle
;
15 * Default implementation of {@link LocaleBundleInterface}.
17 * @author Bernhard Schussek <bschussek@gmail.com>
19 class LocaleBundle
extends AbstractBundle
implements LocaleBundleInterface
24 public function getLocaleName($ofLocale, $locale = null)
26 if (null === $locale) {
27 $locale = \Locale
::getDefault();
30 return $this->readEntry($locale, array('Locales', $ofLocale));
36 public function getLocaleNames($locale = null)
38 if (null === $locale) {
39 $locale = \Locale
::getDefault();
42 if (null === ($locales = $this->readEntry($locale, array('Locales')))) {
46 if ($locales instanceof \Traversable
) {
47 $locales = iterator_to_array($locales);