PoItem::formatItem

private PoItem::formatItem()

Format the POItem as a string.

File

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

Class

PoItem
PoItem handles one translation.

Namespace

Drupal\Component\Gettext

Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.