[meta] Conform to WCAG Success Criterion 3.1.2: Language of Parts

Created on 27 October 2011, about 13 years ago
Updated 5 October 2023, about 1 year ago

This is a meta-issue for the integration of the concept of 'language of parts' in Drupal core. Language of parts is an accessibility requirement in WCAG and is meant to make language changes in texts detectable.

"3.1.2 Language of Parts: The human language of each passage or phrase in the content can be programmatically determined except for proper names, technical terms, words of indeterminate language, and words or phrases that have become part of the vernacular of the immediately surrounding text. (Level AA)" http://www.w3.org/TR/WCAG20/#meaning-other-lang-id

The recommended solution is to use the lang-attribute, for example:
<span lang="de">Ich bin ein Berliner</span> is a quotation from a speech by President John F. Kennedy.

This year in the Netherlands 45% of governmental websites fails on WCAG tests for this issue. Example: A governmental web page that should have language tags.

We discussed this in the last meeting in the accessibility group. As texts are provided in a lot of places, we suggested to break this issue into separate issues for the different levels and uses. First test and if needed file issues for the most common places like text fields.

General UI:
#1164682: links with a known language need language identifier β†’
πŸ› if t() string has no translation or fallback language, text should have lang attribute Closed: won't fix

body field
The default Basic HTML format outputs the language attribute correctly and even transforms it to both xml:lang and lang. However, by default it is not possible to include span, p and div tags. That means that there is at the moment no option to include languages without additional visual markup (as cite, em, strong, blockquote etc).
#1322906: Allow span tag by default for language changes? β†’
#1328768: attributes 'xml:lang' and 'xml:id' transform to 'lang' and 'id' in filter_xss β†’
✨ Language of parts: Introduce a language toolbar button Fixed
#3174111: Automatically enable the language toolbar button on multilingual sites β†’

text field
For text fields the default plain text format is not sufficient, an html filter should be included to output the language attribute.
✨ Allow text field to enforce a specific text format Fixed

file field
Support language of parts for file description
πŸ› Support language of parts for file description Needs work

title field
Titles accept only plain text. There is no easy solution for this. Fix would be to have titles as text fields.
#1188394: Make title behave as a configurable, translatable field (again) β†’

nodes/entities
#1164926: Nodes need to have languages specified separately for accessibility β†’
πŸ› Language attribute is not attached to node title on a full page view Active

comments
πŸ› When viewing a node in another language as interface language, comment form should have correct language Active

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

See also:
#1165466: Language of parts, accessibility and multilanguage: language button β†’
#724128: Impossible to add "xml:lang" in a translatable field β†’
discussion http://groups.drupal.org/node/145894

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component
Language systemΒ  β†’

Last updated 1 day ago

  • Maintained by
  • πŸ‡©πŸ‡ͺGermany @sun
Created by

πŸ‡³πŸ‡±Netherlands Hanno

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

Not all content is available!

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

  • πŸ‡ΊπŸ‡ΈUnited States charles belov San Francisco, CA, US

    "Filtered HTML format" in Drupal 7 is now called "Basic HTML format" in Drupal 10, if I am understanding this correctly. I have made this change to the Body section.

Production build 0.71.5 2024