Problem/Motivation

On a site with an interface language other than English, two CKEditor 5 plugins keep English labels although core/assets/vendor/ckeditor5/ has their translations: the fullscreen button ("Enter fullscreen mode", "Leave fullscreen mode") and the autoformat entry of the accessibility help ("Revert autoformatting action"). Ckeditor5Hooks::libraryInfoAlter() only attaches translation files to a library that depends on core/ckeditor5.translations. ckeditor5.fullscreen (added in #3331158: Support full-screen editing in CKEditor) and ckeditor5.autoformat (added in #3227354: Add support for ckeditor5-autoformat) lack that dependency, and they are the only plugin libraries on 11.x that ship translations without it. Show blocks had the same problem in #3472458: CKEditor 5 show blocks label is not translated. Main is not affected, because all plugins are in core/ckeditor5 there.

Steps to reproduce

  1. On Drupal 11.4.11 with Dutch as interface language and its translations imported, add the Fullscreen button to the CKEditor 5 toolbar of a text format.
  2. Edit content with that text format: the tooltip of the button reads "Enter fullscreen mode" instead of "Volledig scherm openen".
  3. Put the cursor in the editor and press Alt+0: among the Dutch entries of the accessibility help, the entry for Backspace reads "Revert autoformatting action".

Proposed resolution

Add core/ckeditor5.translations to the dependencies of ckeditor5.fullscreen and ckeditor5.autoformat. Each library then carries the translation files of its plugin, and Ckeditor5Hooks::jsAlter() keeps the one for the current language. With this change both libraries get 72 translation files on 11.4.11, the tooltip reads "Volledig scherm openen" and the accessibility help reads "Maak automatisch formattering ongedaan".

Remaining tasks

User interface changes

The labels of the fullscreen button and the autoformat entry of the accessibility help follow the interface language.

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3633856

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

hansrossel created an issue. See original summary.

hansrossel’s picture

Title: CKEditor 5 fullscreen button labels are not translated » CKEditor 5 fullscreen and autoformat labels are not translated
Issue summary: View changes
Related issues: +#3227354: Add support for ckeditor5-autoformat

The autoformat plugin library lacks the same dependency, so the "Revert autoformatting action" entry of the accessibility help stays in English. The merge request now has a second commit for it, and the title and summary cover both libraries. No other plugin library on 11.x ships translations without the dependency.