protected function writeMsgid(POString $string)
 {
     $this->writeLine(sprintf('msgid %s', $this->quote($string->getMsgid())));
     if ($plural = $string->getMsgidPlural()) {
         $this->writeLine(sprintf('msgid_plural %s', $this->quote($plural)));
     }
 }
 /**
  * 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;
     }
 }