function PoMemoryWriter::writeItem
Writes the given item.
Parameters
PoItem $item: One specific item to write.
Overrides PoWriterInterface::writeItem
1 call to PoMemoryWriter::writeItem()
- PoMemoryWriter::writeItems in core/
lib/ Drupal/ Component/ Gettext/ PoMemoryWriter.php  - Writes all or the given amount of items.
 
File
- 
              core/
lib/ Drupal/ Component/ Gettext/ PoMemoryWriter.php, line 27  
Class
- PoMemoryWriter
 - Defines a Gettext PO memory writer, to be used by the installer.
 
Namespace
Drupal\Component\GettextCode
public function writeItem(PoItem $item) {
  if (is_array($item->getSource())) {
    $item->setSource(implode(PoItem::DELIMITER, $item->getSource()));
    $item->setTranslation(implode(PoItem::DELIMITER, $item->getTranslation()));
  }
  $context = $item->getContext();
  $this->items[$context != NULL ? $context : ''][$item->getSource()] = $item->getTranslation();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.