Example #1
0
 /**
  * {@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;
 }
Example #2
0
 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'));
 }
Example #3
0
 public function __construct(StructuredBundleReaderInterface $reader)
 {
     parent::__construct(realpath(IcuData::getResourceDirectory() . '/lang'), $reader);
 }