When viewing a panelized node with paragraphs fields in, the default language is always shown, instead of the language for which it's been translated. To reproduce do the following:

- Create multiple languages on the site
- Create a content type with a paragraphs field
- Make the paragraph fields translatable (fields on the paragraph, not the field on the content type)
- Create new content with multiple translations, verify that this works
- Panelize the view mode, and view different translations, note that default language is shown for all translations.

Comments

bkildow created an issue. See original summary.

TomSaw’s picture

Same behavior for me!

japerry’s picture

This appears to be related to #2461695: Support asymmetric translations -- when I have patch #143 applied, turn on paragraphs translations, and turn off paragraphs being translatable themselves, it works.

japerry’s picture

So my last comment doesn't really work. Creating different paragraphs can work in certain use cases, but it means that paragraphs themselves aren't translatable so you cannot send them to smartling, lingotek, etc.

If you're doing simple drupal translations, the patch suggested in #3 works. But there is something wrong between panelizer and paragraphs that is causing paragraphs to render their original language rather than the translated one.

DamienMcKenna’s picture

Issue tags: +Needs tests

Lets put some tests together to confirm it works as intended.

CulacovPavel’s picture

Confirm issue.

abu-zakham’s picture

I can confirm this issue.

sgurlt’s picture

I also can confirm that issue. I tried: https://www.drupal.org/node/2461695#comment-12018370 But without any luck.

AndrewsizZ’s picture

confirm

AndrewsizZ’s picture

seems like problem not only for paragraphs, problem for all entity reference fields

1. create entity reference field
2. create entity for reference and translate this entity
3. add this entity to reference field to node.
4. enable panelizer for this node

you will see that referenced entity on node view will be always in default language, even if you switch language, but if you disable panelizer all works correct on default node view page.

After debug seems like panelizer using viewField in EntityViewBuilder but default node view page using buildComponents in EntityViewBuilder. And issue seems like somewhere between.

ziomizar’s picture

The problems seems that paragraph fields into the host can't be translated.
The default language of fields that reference to a paragraph is always the default one as the field itself is not translatable.
Other fields works properly, but with paragraphs i have this problem too.

TipiT’s picture

I confirm. I applied https://www.drupal.org/project/paragraphs/issues/2461695#comment-12293048 and tried different congigurations but it seems not to fix this Panelizer issue.

TipiT’s picture

I confirm. I applied https://www.drupal.org/project/paragraphs/issues/2461695#comment-12293048 and tried different congigurations but it seems not to fix this Panelizer issue.

dimr’s picture

Priority: Normal » Critical
Issue tags: -Needs tests +Entity Reference, +Paragraphs, +translations, +panelizer

Using Drupal 8.4.4, Panelizer 8.x-4.0, Panels 8.x-4.2 and followed the documentation https://www.drupal.org/node/2735121 to configure my paragraph as symmetric translations, I can reproduce the same problem here described.

If I don't use Panelizer I can see the content in the selected language, but if I use panelizer then it shows always the default language and no the one of the page. That means that I have all the content that is not Paragraph in the correct language, the one selected in the page, and the paragraphs in the original language. And always I can see the correct language on the edit page of the content.

The issue https://www.drupal.org/project/paragraphs/issues/2461695#comment-12293048 is related to the asymmetric translations, that is another issue I think.

AndersNielsen’s picture

I can confirm the issue.

Tried to do some debugging, and it seems to me it's not panelizer but instead the bug is comming from the ctools_block module.

If I add the same field as a normal (ctools)block outside the panelizer area, it will have the same behaviour. This beeing that it always shows the paragraphs in the default language, not the translated one.

dimr’s picture

I was able to reproduce what @AndersNielsen described.
Then it is clear that this issue is not about Panelizer module, I have found this issue in the ctools module, but I am not sure if we are talking about the same problem.

https://www.drupal.org/project/ctools/issues/2700023

Has anyone clued if we are talking about the same?

dimr’s picture

After making some test I have realized that the issue only appears using an "Entity Reference Revision" as the fields of "Paragraphs", but not using the fields "Entity Revisions".

Also, I have realized that creating a View Block showing that field "Entity Reference Revision" and adding that block in the Panelizer that will work too, it will be shown in the correct language.

I have created an issue in the module "Entity Reference Revision" for that.

Steven Buteneers’s picture

This is related to a core issue with EntityViewBuilder::viewField()

See: https://www.drupal.org/project/drupal/issues/2955392. The patches in this issue fix the problem in this issue.

ziomizar’s picture

pburgh’s picture

We've also run in to this issue. Running 8.6.4 with PHP 7.1.20, Paragraphs did not translate when used on a panelized node. Switching to PHP 5.x fixed the issue, but we're not interested in using PHP 5.x. The solution was to move to PHP 7.1.25 and then everything started working as designed. Hopefully this helps someone.