function PoItem::setTranslation

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

Sets the translation string(s) if the translation has plurals.

Parameters

string|array $translation: The translation string or the array of strings if the translation has plurals.

1 call to PoItem::setTranslation()
PoItem::setFromArray in core/lib/Drupal/Component/Gettext/PoItem.php
Create the PoItem from a structured array.

File

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

Class

PoItem
PoItem handles one translation.

Namespace

Drupal\Component\Gettext

Code

public function setTranslation($translation) {
    $this->translation = $translation;
}

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