Local actions context setting does not work in *.links.action.yml

Created on 28 April 2020, about 4 years ago
Updated 24 August 2023, 10 months ago

I wanted to create a local action button with text 'Order', but the translation of it needed to have context so 'order' is more like in 'order this item now' and not like 'order these items alphabetically'. (because that is translated different in other languages).

So I created a mymodule.links.action.yml file in my custom module:

mymodule.add_order:
  route_name: 'mymodule.add_order'
  title: 'Order'
  title_context: 'mymodule'
  options:
    query:
      destination: '/admin/dealers/dashboard'
  appears_on:
    - mymodule.dashboard

However, the text 'Order' never gets the translation context 'mymodule', So I only see the general translation (where context = '') of 'Order' in the translate interface menu (admin/config/regional/translate), but there is NOT an entry there for a translation of 'Order' that says: 'In Context: mymodule'.

So in short: adding 'title_context' to a *.links.action.yml file does NOT set the translation context of the title.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

11.0 πŸ”₯

Component
Language systemΒ  β†’

Last updated 1 day ago

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

πŸ‡§πŸ‡ͺBelgium flyke

Live updates comments and jobs are added and updated live.
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.

  • πŸ‡¦πŸ‡ΊAustralia mstrelan

    I think this might have been fixed. I've tried to replicate with the following steps:

    1. Install Drupal with demo_umami profile
    2. Navigate to /en/admin/config/regional/translate
    3. Search for "Add content block" and find no results
    4. Navigate to /es/admin/content/block
    5. Navigate to /en/admin/config/regional/translate
    6. Search for "Add content block" and find option to translate default context
    7. Edit block_content.links.action.yml and add title_context: 'Block content' to block_content_add_action
    8. Clear cache
    9. Navigate to /en/admin/config/regional/translate
    10. Search for "Add content block" and find results for default context and Block content context

    If you're still having trouble please reopen the issue with steps to reproduce.

Production build 0.69.0 2024