Exemplo n.º 1
0
 /**
  * Returns an array of phrases used by JavaScript files in a specific area of magento.
  *
  * @param string $area of magento to search, such as 'frontend' or 'adminthml'
  * @return string[]
  */
 protected function _getJavascriptPhrases($area)
 {
     $jsPhrases = array();
     foreach ($this->_utilityFiles->getJsFilesForArea($area) as $file) {
         $this->_parser->parse($file);
         $jsPhrases = array_merge($jsPhrases, $this->_parser->getPhrases());
     }
     return $jsPhrases;
 }
Exemplo n.º 2
0
 public function testParse()
 {
     $expectedResult = array(array('phrase' => 'Phrase 1', 'file' => $this->_testFile, 'line' => $this->_stringsCount - 2, 'quote' => Phrase::QUOTE_SINGLE), array('phrase' => 'Phrase 2 %1', 'file' => $this->_testFile, 'line' => $this->_stringsCount - 1, 'quote' => Phrase::QUOTE_DOUBLE));
     $this->_adapter->parse($this->_testFile);
     $this->assertEquals($expectedResult, $this->_adapter->getPhrases());
 }