public function PoMemoryWriter::writeItem

Implements Drupal\Component\Gettext\PoWriterInterface::writeItem().

Overrides PoWriterInterface::writeItem

1 call to PoMemoryWriter::writeItem()

File

drupal/core/lib/Drupal/Component/Gettext/PoMemoryWriter.php, line 36
Definition of Drupal\Component\Gettext\PoMemoryWriter.

Class

PoMemoryWriter
Defines a Gettext PO memory writer, to be used by the installer.

Namespace

Drupal\Component\Gettext

Code

public function writeItem(PoItem $item) {
  if (is_array($item
    ->getSource())) {
    $item
      ->setSource(implode(LOCALE_PLURAL_DELIMITER, $item
      ->getSource()));
    $item
      ->setTranslation(implode(LOCALE_PLURAL_DELIMITER, $item
      ->getTranslation()));
  }
  $context = $item
    ->getContext();
  $this->_items[$context != NULL ? $context : ''][$item
    ->getSource()] = $item
    ->getTranslation();
}