function PoItem::formatSingular

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Component/Gettext/PoItem.php \Drupal\Component\Gettext\PoItem::formatSingular()
  2. 8.9.x core/lib/Drupal/Component/Gettext/PoItem.php \Drupal\Component\Gettext\PoItem::formatSingular()
  3. 10 core/lib/Drupal/Component/Gettext/PoItem.php \Drupal\Component\Gettext\PoItem::formatSingular()

Formats a singular translation.

1 call to PoItem::formatSingular()
PoItem::formatItem in core/lib/Drupal/Component/Gettext/PoItem.php
Format the POItem as a string.

File

core/lib/Drupal/Component/Gettext/PoItem.php, line 265

Class

PoItem
PoItem handles one translation.

Namespace

Drupal\Component\Gettext

Code

private function formatSingular() {
    $output = '';
    $output .= 'msgid ' . $this->formatString($this->source);
    $output .= 'msgstr ' . (isset($this->translation) ? $this->formatString($this->translation) : '""');
    return $output;
}

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