Untranslated field labels 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, but configuration translation has not been enabled, then field labels will only ever appear in the site language. If a field label is rendered on a translated version of a page, I would expect that label 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 field label 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. Edit the display to show the label of the Body field above the field.
6. Add Content > Article
7. Enter a title "English page with some untranslatable content"
8. Enter body text "This content is translatable"
9. Leave the page language as English
10. Save/publish
11. Click the Translate tab
12. Replace the title with "Página en español"
13. Replace the body with "Este contenido es traducible."
14. Save/publish
17. Right-click the word "Body"

Expected result:
<div class="field__label" lang="en">Body</div>

Actual result:
<div class="field__label">Body</div>

This issue is different from the related issue 🐛 Untranslatable fields on translations of nodes are not marked for Language of Parts Active in that the field label may be independently translated from an untranslatable field by enabling configuration translation and interface translation and translating the field label of the untranslatable field.

Proposed resolution

Change Drupal code to produce the expected result.

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 1 day 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