- 🇯🇵Japan ultrabob Japan
This does not work as expected in Open Social 12.
The group is translated:
In English it shows up properly:
In French interface it still shows in English:Here is a modified patch to make it work again.
User story:
Benefit: In order to find a group
Role: As a site manager
Goal/desire: I want to see a list of group titles in my currently-selected language
I have a multi-lingual OpenSocial 8 site, where the primary language is English, and the other installed language is French (detection is done with /en/
and /fr/
path prefixes. I have marked Group entities, and their Title field, as translatable at /en/admin/config/regional/content-language
.
If I create a Group in English, then translate it into French, the group title always appears in the source language (i.e.: English) at BOTH /en/admin/group
and /fr/admin/group
. I was expecting the English title to appear at /en/admin/group
and the French title to appear at /fr/admin/group
.
Some investigation reveals that \Drupal\group\Entity\Controller\GroupListBuilder::buildRow()
is being overridden by \Drupal\social_group\Controller\SocialGroupListBuilder::buildRow()
. This file calls $entity->label()
(where $entity
is an instance of \Drupal\group\Entity\Group
). While I'd expect this to work, it does not - near as I can tell, the $entity
instance does not have context about the current language for whatever reason.
Things do seem to work when I call $entity->getTranslation(\Drupal::languageManager()->getCurrentLanguage()->getId())->toLink()->toRenderable()
I will attach a patch which uses proper dependency injection.
The list of groups at /admin/group
will display content in the currently-selected content language.
N/A
N/A
To be determined.
Needs review
12.1
Groups
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
This does not work as expected in Open Social 12.
The group is translated:
In English it shows up properly:
In French interface it still shows in English:
Here is a modified patch to make it work again.