Views containing content not in the page's language need to add tags which mark the language of parts

Created on 28 May 2015, over 9 years ago
Updated 20 January 2023, almost 2 years ago

If a view is in one language, but nodes that are in other languages are displayed, those nodes' contents need to be wrapped in a tag with a language attribute.

Steps:
1. At /admin/modules, enable Content Translation and Language modules.
2. At /admin/config/regional/language, add Spanish, Chinese traditional, Arabic.
3. At /admin/config/regional/content-language, check Content, Article, and Basic Page.
4. At /node/add/page, Add content in English (title and body), save and publish.
4. At /node/1/translations, add translations in Spanish, Chinese traditional, Arabic.
5. Structure > Views > Add new view
6. Check Create a page
7. Set name as test 2.
8. Leave display format as Unformatted list of teasers.
9. Click save and edit
10. Go to /test-2. Note that the language of the view is in English.
11. View source

Actual result: Arabic titles and teasers not wrapped in <div lang="ar"></div>, etc. In some cases there is an hreflang attribute, but that's the language of the target page, not a marking of the language on the current page.
Expected result: Arabic titles and teasers wrapped in <div lang="ar"></div>, etc.

Language on a page not in the page's language is supposed to be marked up with the lang attribute due to the language of parts accessibility requirement.

I would also expect this to happen with fields, although with fields there might be a workaround with rewriting.

Feature request
Status

Active

Version

10.1

Component
Views 

Last updated about 4 hours ago

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.

  • D8MI

    (Drupal 8 Multilingual Initiative) is the tag used by the multilingual initiative to mark core issues (and some contributed module issues). For versions other than Drupal 8, use the i18n (Internationalization) tag on issues which involve or affect multilingual / multinational support. That is preferred over Translation.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024