PoItem::formatPlural

private PoItem::formatPlural()

Formats a plural translation.

File

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

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
private function formatPlural() {
  $output = '';
 
  // Format source strings.
  $output .= 'msgid ' . $this->formatString($this->_source[0]);
  $output .= 'msgid_plural ' . $this->formatString($this->_source[1]);
 
  foreach ($this->_translation as $i => $trans) {
    if (isset($this->_translation[$i])) {
      $output .= 'msgstr[' . $i . '] ' . $this->formatString($trans);
    }
    else {
      $output .= 'msgstr[' . $i . '] ""' . "\n";
    }
  }
 
  return $output;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.