Example #1
0
 /**
  * @test
  */
 public function canParseXliffInFrench()
 {
     $LOCAL_LANG = $this->parser->getParsedData($this->xliffFileNames['locallang'], 'fr');
     $this->assertArrayHasKey('fr', $LOCAL_LANG, 'fr key not found in $LOCAL_LANG');
     $expectedLabels = array('label1' => 'Ceci est le libellé no. 1', 'label2' => 'Ceci est le libellé no. 2', 'label3' => 'Ceci est le libellé no. 3');
     foreach ($expectedLabels as $key => $expectedLabel) {
         $this->assertEquals($expectedLabel, $LOCAL_LANG['fr'][$key][0]['target']);
     }
 }
 public function getLabelArrayFromFile($file, $languageKey = 'default')
 {
     $xml = $this->xliffParser->getParsedData($file, $languageKey);
     return $this->flattenLocallangArray($xml, 'xlf', $languageKey);
 }