protected function writeMsgctxt(POString $string) { if ($msgctxt = $string->getMsgctxt()) { $this->writeLine(sprintf('msgctxt %s', $this->quote($msgctxt))); } }
/** * Add POString instance to catalog. If identical string already exists, * reference and extracted comment attributes will be merged. */ public function add(POString $string) { $id = $string->getMsgctxt() . "" . $string->getMsgid(); $category = $string->getCategoryText(); $domain = $string->getDomain(); if (isset($this->strings[$category][$domain][$id])) { array_map(array($this->strings[$category][$domain][$id], 'addReference'), $string->getReferences()); array_map(array($this->strings[$category][$domain][$id], 'addExtractedComment'), $string->getExtractedComments()); } else { $this->strings[$category][$domain][$id] = $string; } }