Untranslatable fields on translations of nodes are not marked for Language of Parts

Created on 19 May 2023, over 1 year ago
Updated 26 May 2023, over 1 year ago

Problem/Motivation

If content translation has been enabled for a website, then fields within a content type can be designated as translatable or untranslatable. If untranslatable content is rendered on a translated version of a page, I would expect that content to be surrounded with a tag that marks its language as not being in the page's language. However, as of Drupal 10.0.9, the content is not being so marked.

Steps to reproduce

As an administrator:
1. Create an English-language website
2. Add Spanish as a content translation language
3. Make the Article content type translatable and hide untranslatable fields from translation edits
4. Make all the existing fields translatable
5. Add a field to the article content type named "Untranslatable body" (without the quotes)
6. Make that new field untranslatable and do not hide the label
7. Add Content > Article
8. Enter a title "English page with some untranslatable content"
9. Enter body text "This content is translatable"
10. Enter untranslatable body text "This content is not translatable."
11. Leave the page language as English
12. Save/publish
13. Click the Translate tab
14. Replace the title with "Página en inglés con contenido intraducible en inglés"
15. Replace the body with "Este contenido es traducible."
16. Save/publish
17. Right-click the words "This content is not translatable."

Expected result:
<div class="field__item" lang="en"><p>This content is not translatable.</p></div>

Actual result:
<div class="field__item"><p>This content is not translatable.</p></div>

Proposed resolution

Change Drupal code to produce the expected result. OK

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Active

Version

10.0

Component
Language system 

Last updated about 16 hours ago

  • Maintained by
  • 🇩🇪Germany @sun
Created by

🇺🇸United States charles belov San Francisco, CA, US

Live updates comments and jobs are added and updated live.
  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024