/** * {@inheritdoc} */ public function getScriptNames($locale = null) { if (null === $locale) { $locale = \Locale::getDefault(); } $scripts = parent::getScriptNames($locale); $collator = new \Collator($locale); $collator->asort($scripts); return $scripts; }
public function testGetScriptNames() { $sortedScripts = array('Cyrl' => 'cyrillique', 'Latn' => 'latin'); $this->reader->expects($this->once())->method('readEntry')->with(self::RES_DIR, 'en', array('Scripts'))->will($this->returnValue($sortedScripts)); $this->assertSame($sortedScripts, $this->bundle->getScriptNames('en')); }
public function __construct(StructuredBundleReaderInterface $reader) { parent::__construct(realpath(IcuData::getResourceDirectory() . '/lang'), $reader); }