public function PoHeader::setFromString

public PoHeader::setFromString($header)

Populate internal values from a string.

Parameters

string $header: Full header string with key-value pairs.

File

core/lib/Drupal/Component/Gettext/PoHeader.php, line 138

Class

PoHeader
Gettext PO header handler.

Namespace

Drupal\Component\Gettext

Code

public function setFromString($header) {
  // Get an array of all header values for processing.
  $values = $this->parseHeader($header);

  // There is only one value relevant for our header implementation when
  // reading, and that is the plural formula.
  if (!empty($values['Plural-Forms'])) {
    $this->_pluralForms = $values['Plural-Forms'];
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Component!Gettext!PoHeader.php/function/PoHeader::setFromString/8.1.x