private function PoStreamReader::shortenComments in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Component/Gettext/PoStreamReader.php \Drupal\Component\Gettext\PoStreamReader::shortenComments()
- 9 core/lib/Drupal/Component/Gettext/PoStreamReader.php \Drupal\Component\Gettext\PoStreamReader::shortenComments()
Generates a short, one-string version of the passed comment array.
Parameters
$comment: An array of strings containing a comment.
Return value
Short one-string version of the comment.
File
- core/
lib/ Drupal/ Component/ Gettext/ PoStreamReader.php, line 580
Class
- PoStreamReader
- Implements Gettext PO stream reader.
Namespace
Drupal\Component\GettextCode
private function shortenComments($comment) {
$comm = '';
while (count($comment)) {
$test = $comm . substr(array_shift($comment), 1) . ', ';
if (strlen($comm) < 130) {
$comm = $test;
}
else {
break;
}
}
return trim(substr($comm, 0, -2));
}