public function PoDatabaseWriter::writeItem in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/locale/src/PoDatabaseWriter.php \Drupal\locale\PoDatabaseWriter::writeItem()
Writes the given item.
Parameters
PoItem $item: One specific item to write.
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 184 - Contains \Drupal\locale\PoDatabaseWriter.
Class
- PoDatabaseWriter
- Gettext PO writer working with the locale module database.
Namespace
Drupal\localeCode
public function writeItem(PoItem $item) {
if ($item
->isPlural()) {
$item
->setSource(implode(LOCALE_PLURAL_DELIMITER, $item
->getSource()));
$item
->setTranslation(implode(LOCALE_PLURAL_DELIMITER, $item
->getTranslation()));
}
$this
->importString($item);
}