Language of parts: Introduce a language toolbar button

Created on 13 May 2013, over 11 years ago
Updated 27 August 2023, over 1 year ago

Problem/Motivation

When editing multilingual texts, editors should be able to add language attributes in the text to comply for WCAG2. To support this, a language button is very helpful.

Background

WCAG 2.0 accessibility guidelines require that parts of a text in another language need a language attribute (see Understanding 3.1.2 Language of Parts). With this attribute readspeakers can adapt to the right language. So in the editor it would be great if editors can select a part of a text and give that selection the right language with a button.

For example:

This paragraph is in English , but... 
Este apartado está en español.

Should be tagged like this:

<p>This paragraph is in English, but...<br />
<span lang="es">Este apartado está en español.</span></p>

Assuming that the default language is set to English (already the case): <html lang="en-US">

Proposed resolution

CKEditor has since 4.3 a dropdown language button integrated. Now we've ckeditor 4.4 in Drupal we can integrate this button:
1. add the plugin in the core/assets/vendor/ckeditor
2. add a language plugin in core/modules/ckeditor
3. add the language dropdown button in the toolbar
4. add a configurable interface to make the available languages selectable (http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-language_list). Default languages included in the dropdown: spanish, arabic, french

Screenshot when configuring the plugin:

Screenshot when using the plugin:

Screenshot of resulting processed markup:

See also

WCAG 2.0: Understanding 3.1.2 Language of Parts: http://www.w3.org/WAI/GL/UNDERSTANDING-WCAG20/meaning-other-lang-id.html
WCAG 2.0: No changes for 3.1.2 regarding to HTML5: http://www.w3.org/WAI/GL/wiki/Techniques/HTML5
#1165466: Language of parts, accessibility and multilanguage: language button
#1322906: Allow span tag by default for language changes?
Ticket at ckeditor: http://dev.ckeditor.com/ticket/7987
Plugin at ckeditor: http://ckeditor.com/addon/language
Typo3: ticket with commit: http://forge.typo3.org/issues/19852
Wordpress: plugin http://wordpress.org/extend/plugins/accessibility-language/
http://sprungmarker.de/en/2011/wordpress-editor-plugin-mce-accessible-la...
Ticket for Moodle: https://tracker.moodle.org/browse/MDL-26723

Remaining tasks

None.

User interface changes

None.

(It's now possible to optionally add a new button to CKEditor. In that way, site builders are thus given the possibility to change the UI.)

API changes

Added CKEditorPluginManager::getEnabledButtons(Editor $editor).

Data model changes

None.

Feature request
Status

Fixed

Version

8.1 ⚰️

Component

ckeditor.module

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.

  • 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.

  • API addition

    Enhances an existing API or introduces a new subsystem. Depending on the size and impact, possibly backportable to earlier major versions.

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.

Production build 0.71.5 2024