Problem/Motivation

The contextual links trigger uses uncontextualized Open and Close strings. Open can describe a state or an action. A translation appropriate for the state can therefore appear on the action button: for example, Spanish Abierta instead of Abrir.

Steps to reproduce

  1. Enable Contextual Links and Interface Translation and add Spanish.
  2. Translate the uncontextualized Open string as Abierta.
  3. View a page with contextual links as a user with permission to use them, in Spanish.
  4. Inspect the contextual trigger accessible label. It uses the adjective rather than the action verb.

Proposed resolution

Use the Verb translation context for both Open and Close in core/modules/contextual/js/contextual.js. This lets translators distinguish the trigger actions from state labels without changing uncontextualized translations elsewhere.

Remaining tasks

Review the patch and add regression coverage for contextual trigger translations.

User interface changes

No English label change. Translated labels can use the appropriate verbs.

API and data model changes

None.

CommentFileSizeAuthor
drupal-contextual-verb.patch551 bytesjmcerda

Issue fork drupal-3629113

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

jmcerda created an issue. See original summary.

quietone’s picture

Version: 11.4.x-dev » main
Issue tags: +Needs merge request

Changes are made on main, then backported according to Drupal core policy.

There is another issue about adding context for translations. It should be found and added as related. Well, unless it is a duplicate.

abdellah.hmache made their first commit to this issue’s fork.

smustgrave’s picture

Status: Needs review » Needs work

MR appears to be AI

since it was not disclosed and appears to be copy and paste putting back in NW