[pp-1] Media type names are not being translated in /group/GID/media/create

Created on 10 January 2022, almost 3 years ago
Updated 19 October 2023, about 1 year ago

Problem/Motivation

When you access to /group/GID/media/create in order to create a content related with a group, the media type will be always shown in the language that was used when cleared the cache the last time.

There is already an issue for this https://www.drupal.org/project/drupal/issues/3038717 🐛 Block/menu/views derivative labels are always shown in the first language they are view in after cache rebuild Needs work . What we have to do is to use the TranslatableEntityLabelMarkup new class provided in this issue instead of using the name Media Type name coming from the entity's label method.

Steps to reproduce

Add the Spanish language in Drupal
Translate the Image media type name to the new language ("Imagen" in this case)
Configure a group type to be able to have media of type Image
Create a group of this type
Go to /en/group/GID/media/create and check that the item name is "Group media (Image)"
Go to /es/group/GID/media/create and check that the item name is "Group media (Image) " when it should be "Group media (Imagen)"
Go to /es/admin and clear the Drupal cache (ensuring you are in the Spanish administration interface)
Go to /en/group/GID/media/create and check that the item name is "Group media (Imagen)" when it should be "Group media (Image)"
Go to /es/group/GID/media/create and check that the item name is "Group media (Imagen) "

Proposed resolution

Use the TranslatableEntityLabelMarkup when building the plugin label in the \Drupal\groupmedia\Plugin\GroupContentEnabler\GroupMediaDeriver

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇪🇸Spain unstatu

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024