public PoMemoryWriter::writeItem(PoItem $item)
Writes the given item.
Parameters
PoItem $item: One specific item to write.
Overrides PoWriterInterface::writeItem
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\Gettext
Code
1 2 3 4 5 6 7 8 | 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(); } |
Please login to continue.