Paragraph field values don't auto-translate without |translation in Twig templates

Created on 16 July 2025, 18 days ago

### Problem/Motivation

When using Paragraphs with multilingual content, translatable fields like `field_heading`, `field_description`, or `field_menus` do not show translated values on the frontend โ€” even if translations are created.

This only occurs when rendering with Twig templates. Unless we explicitly use the `|translation` filter in the template, the paragraph field values always render in the default language.

This creates inconsistency and confusion for multilingual sites.

---

### Steps to reproduce

1. Create a Paragraph type with translatable fields (e.g., text or link fields).
2. Reference that paragraph in a node or block.
3. Enable another language (e.g., French) and translate both the node and its paragraph values.
4. On the frontend, translated paragraph fields are not shown.
5. Add this in the Twig template:

{% for section in content.field_sections['#items'] %}
  {% set item_entity = section.entity|translation %}
  <div class="skiPanelWrap">
    {% if item_entity.field_title_link.uri %}
      <a href="{{ item_entity.field_title_link.uri }}" class="section-link">
        {{ item_entity.field_title_link.title }}
      </a>
    {% endif %}
  </div>
{% endfor %}

Expected behavior

Paragraph fields should automatically render their translated values when a translated parent entity is being viewed โ€” without requiring |translation manually in templates.

Workaround

Using the |translation filter in custom Twig templates works:

{% set item = item.entity|translation %}

Proposed resolution

Either:

Automatically apply the correct translation context when rendering paragraph fields.

Or clearly document this requirement for developers using Twig with multilingual content.

๐Ÿ› Bug report
Status

Needs review

Version

11.0 ๐Ÿ”ฅ

Component

field system

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu raj Noida

Live updates comments and jobs are added and updated live.
  • Needs documentation

    A documentation change is requested elsewhere. For Drupal core (and possibly other projects), once the change has been committed, this status should be recorded in a change record node.

Sign in to follow issues

Comments & Activities

  • Issue created by @himanshu raj
  • Implemented a theme-level workaround using hook_preprocess_paragraph() to ensure translated paragraph field values are rendered automatically without needing to use the |translation filter manually in Twig templates.

    This improves consistency across multilingual sites and removes the need for repetitive Twig adjustments.

    function YOURTHEME_preprocess_paragraph(array &amp;$variables) { \$langcode = \Drupal::languageManager()->getCurrentLanguage()->getId(); if (!empty(\$variables['paragraph']) &amp;&amp; \$variables['paragraph']->hasTranslation(\$langcode)) { \$variables['paragraph'] = \$variables['paragraph']->getTranslation(\$langcode); } }
    This workaround respects the current language context and works well with translated paragraph entities inside nodes or blocks.

  • ๐Ÿ‡บ๐Ÿ‡ธUnited States smustgrave

    Don't see anything to review here.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia himanshu raj Noida

    Hi guys,
    Currently, paragraph field values in multilingual sites do not auto-translate in Twig templates unless we explicitly use the |translation filter. This feels inconsistent, especially when the parent entity (like a translated node or block) is rendered correctly in the current language.

    Using |translation manually in every template is not scalable or developer-friendly. Also, relying on hook_preprocess_paragraph() or other custom workarounds is not ideal for long-term multilingual support.

    It would be great if this behavior is handled automatically by Drupal core or the Paragraphs module โ€” so that referenced paragraphs follow the parentโ€™s language context, just like other translatable fields.

    If anyone has a clean solution or update on this, please let me know. Thanks!

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium BramDriesen Belgium ๐Ÿ‡ง๐Ÿ‡ช

    I think this needs a lot of clarification. It sounds more like a paragraphs issue. On the other hand I have no reasons to believe paragraph fields are untranslatable.

Production build 0.71.5 2024