Skip to content

Commit

Permalink
Issue #3450999 by SV: Use translated term name in group_type variable
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-sydor authored and ribel committed Jun 3, 2024
1 parent 1596966 commit a5a67af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modules/social_features/social_group/social_group.module
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,9 @@ function social_group_preprocess_group(array &$variables) {
$term = $group->get('field_group_type')->entity;

if ($term instanceof Term) {
$variables['group_type'] = $term->getName();
/** @var \Drupal\Core\Entity\EntityInterface $entity */
$entity = \Drupal::service('entity.repository')->getTranslationFromContext($term);
$variables['group_type'] = $entity->label();
$variables['group_type_icon'] = $term->get('field_group_type_icon')->getString();
}
}
Expand Down

0 comments on commit a5a67af

Please sign in to comment.