protected static function fixExtractedComments(\Gettext\Translation $translation) { $extractedComments = $translation->getExtractedComments(); $n = count($extractedComments); if ($n > 0) { $m = null; $translation->deleteExtractedComments(); foreach (array_unique($extractedComments) as $extractedComment) { if (preg_match('/^\\s*i18n:?\\s*(.*)\\s*$/s', $extractedComment, $m)) { $translation->addExtractedComment($m[1]); } else { $translation->addExtractedComment($extractedComment); } } } }