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
- Enable Contextual Links and Interface Translation and add Spanish.
- Translate the uncontextualized Open string as Abierta.
- View a page with contextual links as a user with permission to use them, in Spanish.
- 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.
| Comment | File | Size | Author |
|---|---|---|---|
| drupal-contextual-verb.patch | 551 bytes | jmcerda |
Issue fork drupal-3629113
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
Comment #2
quietone commentedChanges 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.
Comment #6
smustgrave commentedMR appears to be AI
since it was not disclosed and appears to be copy and paste putting back in NW