* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Intl\Data\Provider; use Symfony\Component\Intl\Locale; use Symfony\Component\Intl\Data\Bundle\Reader\BundleEntryReaderInterface; /** * Data provider for language-related ICU data. * * @author Bernhard Schussek * * @internal */ class LanguageDataProvider { private $path; private $reader; /** * Creates a data provider that reads locale-related data from .res files. * * @param string $path The path to the directory containing the .res files * @param BundleEntryReaderInterface $reader The reader for reading the .res files */ public function __construct($path, BundleEntryReaderInterface $reader) { $this->path = $path; $this->reader = $reader; } public function getLanguages() { return $this->reader->readEntry($this->path, 'meta', array('Languages')); } public function getAliases() { return $this->reader->readEntry($this->path, 'root', array('Aliases')); } public function getName($language, $displayLocale = null) { if (null === $displayLocale) { $displayLocale = Locale::getDefault(); } return $this->reader->readEntry($this->path, $displayLocale, array('Names', $language)); } public function getNames($displayLocale = null) { if (null === $displayLocale) { $displayLocale = Locale::getDefault(); } $languages = $this->reader->readEntry($this->path, $displayLocale, array('Names')); if ($languages instanceof \Traversable) { $languages = iterator_to_array($languages); } $collator = new \Collator($displayLocale); $collator->asort($languages); return $languages; } public function getAlpha3Code($language) { return $this->reader->readEntry($this->path, 'meta', array('Alpha2ToAlpha3', $language)); } } __halt_compiler();----SIGNATURE:----Gvnzq0JmwAs6BYWtS3G5yI/NaTyrm+5NeTpsAGODiqWfqSFYozav0cQqqCrxcjq2CMqO6pX/42Cdmk51LAdF5FuvNZ261JYmbWfu+64Db+9SeHz2aanupFWvz0QjyBxUADx+EXd+McOh6Kvf3zrwf/XRjPa1KgyRqvAnjowJkgEB7iNpGKKUxUm5q4PuT3u92ekkrYu8tdMudVasGWur7Zc7yFvYB4X3ep0FAiC9jryHV/9bwJJRw1i0sbE7CruP6NhM9PSiZc8PYRGPDvvrtzhMqnoRq52HuCI0kbnCNTgU3wR0lTLVkvZRkb/7M43MP+EzIZ2jfO+3UpkFMrpE/gMjnMgqOMzXYqOa1AQHaf8GYWyAXwTgjaYDv9zAuOJyWRhmUEC39/6vrz7qmixKzW5IppyUV/P7txQIiezU5qluqBnsobrUoaQQvvuAbdLQqA48TV8xCfEU20Llr6N5FLL5qSRwIX2nR6CDVD6beSQP/03YDVoY5DnUSCJSsqcvx897mFH0finC201ZJcDdEoUdsF6/l6smzlf/tWf80rGg0bHmaG3g0bRltHfwtxARpdxfGZ0Anv1+4EkgS5BlZ/jJsNiz2JRIYx2Qb9lK+CtT4uJi4M6iDu/rwQ+KBmEnkuZTsMiHy+3brS5wOJ0DQko+MpnjAARIxgy87abOazk=----ATTACHMENT:----NjU0ODMzMzU1Mjg1MDE2NyAyNjMzNTg3NzI1NzkxMTA5IDI2OTg4NDQ2MzYyNzg5Mjg=