* @package tao */ class tao_helpers_translation_POExtractor extends tao_helpers_translation_RDFExtractor { /** * @param $child * @param $xmlNS * @param $about * @param $tus * @return array */ protected function processUnit($child, $xmlNS, $about, $tus) { if ($child->hasAttributeNS($xmlNS, 'lang')) { $sourceLanguage = 'en-US'; $targetLanguage = $child->getAttributeNodeNS($xmlNS, 'lang')->value; $source = $child->nodeValue; $target = '';//$child->nodeValue; $tu = new tao_helpers_translation_POTranslationUnit(); $tu->setSource($source); $tu->setTarget($target); $tu->setSourceLanguage($sourceLanguage); $tu->setTargetLanguage($targetLanguage); $tu->setAnnotations([$about]); $tu->setContext($child->namespaceURI . $child->localName); $tus[] = $tu; return $tus; } return $tus; } }