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

Created on 10 January 2022, over 3 years ago
Updated 11 August 2025, about 1 month ago

Problem/Motivation

When you access to /group/GID/node/create in order to create a content related with a group, the content 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 Content Type name coming from the entity's label method.

Steps to reproduce

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

Proposed resolution

Use the TranslatableEntityLabelMarkup when building the plugin label in the \Drupal\gnode\Plugin\GroupContentEnabler\GroupNodeDeriver

🐛 Bug report
Status

Active

Version

1.4

Component

Code

Created by

🇪🇸Spain unstatu

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

Merge Requests

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