You are here

private function PoItem::formatItem in Localization update 7.2

Format the POItem as a string.

Return value

string Formatted PO item.

1 call to PoItem::formatItem()
PoItem::__toString in includes/gettext/PoItem.php
Output the PoItem as a string.

File

includes/gettext/PoItem.php, line 240
Definition of Drupal\Component\Gettext\PoItem.

Class

PoItem
PoItem handles one translation.

Code

private function formatItem() {
  $output = '';

  // Format string context.
  if (!empty($this->_context)) {
    $output .= 'msgctxt ' . $this
      ->formatString($this->_context);
  }

  // Format translation.
  if ($this->_plural) {
    $output .= $this
      ->formatPlural();
  }
  else {
    $output .= $this
      ->formatSingular();
  }

  // Add one empty line to separate the translations.
  $output .= "\n";
  return $output;
}