Pass language object as an option to the URL

Created on 24 June 2019, over 5 years ago
Updated 25 September 2024, 3 months ago

We are facing an issue in our multilingual domains setup. The add translation link behaves quite differently than the link provided by content_translation module. While the content translation module switches the domain to add a translation, views_entity_translations_links doesn't. The reason the missing language option parameter. See \Drupal\content_translation\Controller\ContentTranslationController::overview() for reference:

        $options = ['language' => $language];
        $add_url = $entity->toUrl('drupal:content-translation-add', $options)
          ->setRouteParameter('source', $original)
          ->setRouteParameter('target', $language->getId())

I think we should also pass the language option to get a consistent behaviour.

🐛 Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇭Switzerland dermario Zürich

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.

Production build 0.71.5 2024