public function PoHeader::setFromString in Service Container 7.2
Same name and namespace in other branches
- 7 lib/Drupal/Component/Gettext/PoHeader.php \Drupal\Component\Gettext\PoHeader::setFromString()
Populate internal values from a string.
Parameters
string $header: Full header string with key-value pairs.
File
- lib/
Drupal/ Component/ Gettext/ PoHeader.php, line 143 - Contains \Drupal\Component\Gettext\PoHeader.
Class
- PoHeader
- Gettext PO header handler.
Namespace
Drupal\Component\GettextCode
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'];
}
}