function PoDatabaseWriter::writeItem

Same name in other branches
  1. 8.9.x core/modules/locale/src/PoDatabaseWriter.php \Drupal\locale\PoDatabaseWriter::writeItem()
  2. 10 core/modules/locale/src/PoDatabaseWriter.php \Drupal\locale\PoDatabaseWriter::writeItem()
  3. 11.x core/modules/locale/src/PoDatabaseWriter.php \Drupal\locale\PoDatabaseWriter::writeItem()

Overrides PoWriterInterface::writeItem

1 call to PoDatabaseWriter::writeItem()
PoDatabaseWriter::writeItems in core/modules/locale/src/PoDatabaseWriter.php
Writes all or the given amount of items.

File

core/modules/locale/src/PoDatabaseWriter.php, line 189

Class

PoDatabaseWriter
Gettext PO writer working with the locale module database.

Namespace

Drupal\locale

Code

public function writeItem(PoItem $item) {
    if ($item->isPlural()) {
        $item->setSource(implode(PoItem::DELIMITER, $item->getSource()));
        $item->setTranslation(implode(PoItem::DELIMITER, $item->getTranslation()));
    }
    $this->importString($item);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.