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.
Comments
Comment #1
dawehnerDoes that happen already for rendering an individual node, like for example on
node/1
?Comment #2
Charles BelovTested in beta 11, not in 8.1-dev.
Comment #3
Charles BelovImproved description of issue.
Comment #4
Charles Belov@dawehner: That's actually a different issue.
If an English view is displaying non-English content, then there needs to be language attributes surrounding the non-English content. (This issue)
If a non-English node has untranslated content, then there needs to be language attributes surrounding the English content. (Different issues, possibly including #1164682: links with a known language need language identifier, #1164926: Nodes need to have languages specified separately for accessibility, #1165476: if t() string has no translation or fallback language, text should have lang attribute, and #1323338: [meta] Conform to WCAG Success Criterion 3.1.2: Language of Parts)
Comment #5
mgiffordThanks for opening this Charles. It's definitely a good space to highlight the Language of Parts requirement.
Comment #6
mgifford8.1 issues are being postponed for now.
Comment #7
mgiffordComment #15
andrewmacpherson CreditAttribution: andrewmacpherson as a volunteer and at Annertech commentedNow that the Umami demo profile has content in two languages, the steps-to-reproduce are easier. You can see English and Spanish titles in the main admin/content view.
Comment #19
mgiffordComment #20
mgiffordLinking open issues from the CivicActions Accessibility - VPAT.
Comment #25
mgifford