Skip to content
Snippets Groups Projects

Make "previous revision" label postfix translatable

1 file
+ 2
2
Compare changes
  • Side-by-side
  • Inline
+ 2
2
@@ -237,7 +237,7 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
@@ -237,7 +237,7 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
$field = $parent->get($parent_field);
$field = $parent->get($parent_field);
$label = $parent->label() . ' > ' . $field->getFieldDefinition()->getLabel();
$label = $parent->label() . ' > ' . $field->getFieldDefinition()->getLabel();
// A previous or draft revision or a deleted stale Paragraph.
// A previous or draft revision or a deleted stale Paragraph.
$postfix = ' (previous revision)';
$postfix = $this->t('previous revision');
foreach ($field as $value) {
foreach ($field as $value) {
if ($value->entity && $value->entity->getRevisionId() == $this->getRevisionId()) {
if ($value->entity && $value->entity->getRevisionId() == $this->getRevisionId()) {
$postfix = '';
$postfix = '';
@@ -245,7 +245,7 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
@@ -245,7 +245,7 @@ class Paragraph extends ContentEntityBase implements ParagraphInterface {
}
}
}
}
if ($postfix) {
if ($postfix) {
$label .= $postfix;
$label = $label . ' (' . $postfix . ')';
}
}
}
}
else {
else {
Loading