Problem/Motivation
Apparently, the issue of #3048699: Taxonomies are only displayed in English was actually a bug in Layout Builder #3051188: Translated content displays its taxonomy terms in the wrong language when layout builder is enabled for that content type and not something that needed fixing in Umami itself.
The way it was "resolved" was by allowing different taxonomy terms for each language.
Because of the way we are migrating content into Umami, it seems fine and it bypasses the bug in Layout Builder.
The current setup is wrong because if a recipe is tagged "Dessert", we want it to be tagged the same way in all languages (with the correct translation in each language), but we do not want it to be a separate/different taxonomy term.
Proposed resolution
After #3051188: Translated content displays its taxonomy terms in the wrong language when layout builder is enabled for that content type is resolved, revert the changes that were made in #3048699: Taxonomies are only displayed in English.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | ootb--categories-now-appear-in-spanish.png | 441.4 KB | shaal |
| #2 | demo-umami-recipe-layout-builder-disabled.png | 123.17 KB | shaal |
| #2 | demo-umami-recipe-layout-builder-enabled.png | 122.32 KB | shaal |
| #2 | revert-taxonomies-in-english-3051465-2.patch | 2.15 KB | shaal |
Comments
Comment #2
shaalReverted commit d53ba183648e7459d6418a21236b099537d01339.
Testing
http://drupal.ddev.local/es/recipes/bizcochos-veganos-de-chocolate-y-nueces.After applying this patch, while #3051188: Translated content displays its taxonomy terms in the wrong language when layout builder is enabled for that content type is not fixed, we're getting the expected results:
When Layout Builder is enabled for Recipe pages, taxonomies are displayed in English (because of the bug #3051188: Translated content displays its taxonomy terms in the wrong language when layout builder is enabled for that content type):

When Layout Builder is disabled for Recipe pages: taxonomies are displayed in Spanish:

Comment #3
shaalThis issue is blocked until #2955392: EntityViewBuilder::viewField() does not respect entity current language when used with an entity reference field will get fixed.
Comment #5
shaal#2955392: EntityViewBuilder::viewField() does not respect entity current language when used with an entity reference field is now fixed (in Drupal 8.9.x and 9.0.x).
I tested this patch with the latest Drupal 8.9.x and it works as intended.
Screenshot from a Spanish recipe page:

This patch is very simple, it only changes the setting for categories to stay the same in all languages.
It's ready to be reviewed.
:)
We should bring this patch to Drupal 8.8.x after the patch mentioned above is merged into 8.8.x
Comment #6
berdirThis looks good to me, not sure if it makes sense to have a test? I think if we do add a test then it's more about the right configuration, meaning we should make sure that the field is untranslatable, which means it's only showing up when editing the default translation of an entity?
Comment #9
markconroy commented@Berdir @shaal is this ready to be marked RTBC (presuming the patch still applies after a year!).
Comment #10
markconroy commentedPatch applies cleanly. The site still works. Let's move to RTBC!
Thanks @shaal @Berdir for working on this (and the layout builder team for fixing the original issue).
Comment #12
lauriiiCommitted f8fd7e7 and pushed to 9.2.x. Thanks!