Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Referenced content in tabs and accordions do not render the translated version.
To reproduce:
Set up a tab or accordion type
Set the proper translation settings for all fields (!paragraphs settings)
Translate Content
Comment | File | Size | Author |
---|---|---|---|
#21 | bt_text.png | 19.63 KB | cri2mars |
#21 | bt_accordion_section.png | 20.55 KB | cri2mars |
#21 | bt_accordion.png | 25.15 KB | cri2mars |
#4 | Screen Shot 2017-05-23 at 6.23.07 PM.png | 52.05 KB | phanosd |
#4 | Screen Shot 2017-05-23 at 6.23.21 PM.png | 47.37 KB | phanosd |
Comments
Comment #2
phanosd CreditAttribution: phanosd at Tabs & Spaces commentedFacing the same issue.
Specifically in our stack the situation is likewise.
Our primary version of the website is in English with the following layout
- Content Type Basic Page
- - Title Field
- - Body Field
- - Bootstrap Paragraph Accordion
- - - Background None
- - - Width None
- - - - Accordion Section 1
- - - - - - Accordion Section Title
- - - - - - Accordion Section Body
- - - - Accordion Section 2
- - - - - - Accordion Section Title
- - - - - - Accordion Section Body
Expected behavior
We can translate the content of the paragraphs in order to have a page translation (Greek Translation)
Actual Behavior:
- - Title Field (GR)
- - Body Field (GR)
- - Bootstrap Paragraph Accordion
- - - - Accordion Section 1
- - - - - - Accordion Section Title (GR)
- - - - - - Accordion Section Body (EN)
- - - - Accordion Section 2
- - - - - - Accordion Section Title (GR)
- - - - - - Accordion Section Body(EN)
Also, we've experienced the following:
If you translated the content and go and add another field in the original accordion it does not show in the translated node.
Comment #3
thejimbirch CreditAttribution: thejimbirch commentedRelated Paragraphs Issue: https://www.drupal.org/node/2864682
Comment #4
phanosd CreditAttribution: phanosd at Tabs & Spaces commentedWas looking at the same thing since yesterday.
Got pretty upset with my current website and decided to test on a new installation.
Followed the paragraphs issue here: https://www.drupal.org/node/2864682
Can confirm workaround is not working with this module
- - - - Accordion Section 1
- - - - - - Accordion Section Title
- - - - - - Accordion Section Simple
- - - - - - Accordion Section Simple dummy
- - - - Accordion Section 2
- - - - - - Accordion Section Title
- - - - - - Accordion Section Simple dummy
Actual Behavior:
- - Title Field (GR)
- - Body Field (GR)
- - Bootstrap Paragraph Accordion
- - - - Accordion Section 1
- - - - - - Accordion Section Title (GR)
- - - - - - Accordion Section Simple (EN)
- - - - - - Accordion Section Simple dummy (EN)
- - - - Accordion Section 2
- - - - - - Accordion Section Title (GR)
- - - - - - Accordion Section Simple (EN)
- - - - - - Accordion Section Simple dummy (EN)
The problem still remains also when adding new sections to original content
Comment #5
SoYeah CreditAttribution: SoYeah commentedI build a standalone PG-Tab-Type based on bootstrap.js which is fully translatable as expected.
(Accordions are just some other classes for bootstrap in the template to behave that way.)
1. PG-Type with a PG reference field (Tab Section)
2. PG-Type Tab Section with two fields:
a) Tab Section Title (hidden in display)
b) PG reference field for the tab body
Twig template:
Comment #6
Mikechr CreditAttribution: Mikechr at Tabs & Spaces commentedI've found that accordions and tabs both loaded their inner entities without a translation in mind.
I've tweaked the code a little bit calling .getTranslation() passing the current content language as an argument.
I've uploaded a patch for it.
Comment #7
thejimbirch CreditAttribution: thejimbirch commentedThanks for the fix and the patch @Mikechr!
@SoYeah @phanosd Can you review please?
Comment #8
phanosd CreditAttribution: phanosd at Tabs & Spaces commented#6 Works for me!!
Comment #10
thejimbirch CreditAttribution: thejimbirch commentedComment #11
thejimbirch CreditAttribution: thejimbirch commentedClosed in 8.x-2.0-alpha4. Thanks all!
Comment #12
thejimbirch CreditAttribution: thejimbirch commentedComment #13
pyxio CreditAttribution: pyxio commentedI am still seeing this issue with 8.x-2.0-beta2 ... when i translate a tab name i get the same error ..
Invalid translation language (cs) specified. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 805 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Comment #14
pyxio CreditAttribution: pyxio commentedthis issue is not fixed and should not be marked as fixed. i still get these errors
The website encountered an unexpected error. Please try again later.Drupal\Core\Entity\EntityStorageException: Invalid translation language (cs) specified. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 805 of core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).
Comment #15
thejimbirch CreditAttribution: thejimbirch commentedComment #16
thejimbirch CreditAttribution: thejimbirch commentedCould this be related?
Sub-paragraph fields cannot be translated
https://www.drupal.org/project/paragraphs/issues/2864682
Comment #17
pyxio CreditAttribution: pyxio commentedyes. i think i can say with confidence it is related.
Comment #18
thejimbirch CreditAttribution: thejimbirch commentedComment #19
thejimbirch CreditAttribution: thejimbirch commentedComment #20
cri2mars CreditAttribution: cri2mars commentedhi
i encountered the same issue with tab and accordions
my pov, is that it is of course related and miro dietiker explained in #9 sub-paragraph can't be translated how to solve the issue
you have to activate the translation of the parent paragraph, not the field of the child paragraph of course as it is not permited, but for other fields, authored on or authored by, or anything else.
of course you will never translate this, but it makes the parent paragraph translatable, so the child one can inherit that property...
this way you can translate text (bt_text paragraph), nested into an accordion section (bt_accordion_section), nested into an accordion (bt_accordion), etc...
this works also for tabs of course
a more elegant way to solve this issue could maybe add some new field in the parents of nested paragraphs bundles, something like "translatability"
which would garantee that the translatability should be inherited
Comment #21
cri2mars CreditAttribution: cri2mars commentedhere are some pics taken from $URL/fr/admin/config/regional/content-language
to explain it :
the container accordion paragraph
the nested accordion section
already checked as translatable because of his title
finaly the nested text paragraph (bt_simple)
now i can see accordion section titles translated, as the text nested into each section...
(i use bt language dropdown by the way)
Comment #22
ikaros123 CreditAttribution: ikaros123 commentedYou could use this module https://www.drupal.org/project/paragraphs_asymmetric_translation_widgets.
I was able to translate all paragraph fields using this module.
Comment #23
thejimbirch CreditAttribution: thejimbirch commentedThanks @ikaros123!