How to get links of translated node edit page in the secondary tabs In D7, if a node is translated, let say in French and if you are in the entity.node.edit_form page then you could find 2 secondary tabs: [French] and [English] pointing to the edit_form of each language.

To achieve this in D8, I looked at the derivatives, but they are loaded once during cache clear and can't evaluate the current entity.

Following the 4k4 comment I have tried to subclass LocalTaskDefault
But I am stuck with the following problems:

1-How can I create a route for a defined language (eg: a route to edit a french node)

2-In .links.task.yml: should I create as many tabs as there are languages (I don't think so)

Here is my .links.task.ymlfile

translated_node_tabs:
  class: Drupal\mymodule\Plugin\Menu\TranslatedNodeTab
  title: 'Translated nodes'
  base_route: entity.node.edit_form
  route_name:  entity.node.edit_form 


And here is the very beginning of what I have understood from the 4k4 advice

class TranslatedNodeTab extends LocalTaskDefault {
  /**
   * {@inheritdoc}
   */
  public function getCacheContexts() {
    return [
        'route'
    ];
  }
  /**
   * {@inheritdoc}
   */
  public function getRouteParameters(RouteMatchInterface $route_match) {
    $current_node = $route_match-&gt;getParameter('node');
    if ($current_node instanceof NodeInterface) {
      $nid = $current_node-&gt;id();
      return [
          'node' =&gt; $nid
      ];
    }
    return [];
  }
}
Add a derivative for each language:

/mymodule/src/Plugin/Derivative/TranslatedNodeTabDeriver.php

&lt;?php

namespace Drupal\mymodule\Plugin\Derivative;

use Drupal\Component\Plugin\Derivative\DeriverBase;
use Drupal\Core\StringTranslation\StringTranslationTrait;

class TranslatedNodeTabDeriver extends DeriverBase {

  use StringTranslationTrait;

  /**
   * {@inheritdoc}
   */
  public function getDerivativeDefinitions($base_plugin_definition) {
    $this-&gt;derivatives = [];
    foreach (\Drupal::languageManager()-&gt;getLanguages() as $language) {
      $lang_id = $language-&gt;getId();
      $this-&gt;derivatives[$lang_id] = $base_plugin_definition;
      $this-&gt;derivatives[$lang_id]['title'] = $this-&gt;t('Translate @language', ['@language' =&gt; $language-&gt;getName()]);
    }
    return $this-&gt;derivatives;
  }

}


and then you can get the language id with $this-&gt;getDerivativeId() in the plugin class:

/mymodule/src/Plugin/Menu/TranslatedNodeTab.php

&lt;?php

namespace Drupal\mymodule\Plugin\Menu;

use Drupal\Core\Menu\LocalTaskDefault;
use Drupal\Core\Routing\RouteMatchInterface;

class TranslatedNodeTab extends LocalTaskDefault {

  /**
   * {@inheritdoc}
   */
  public function getOptions(RouteMatchInterface $route_match) {
    $options = parent::getOptions($route_match);
    $options['language'] = \Drupal::languageManager()-&gt;getLanguage($this-&gt;getDerivativeId());
    return $options;
  }

}


/mymodule/mymodule.links.task.yml

translated_node_tabs:
  class: Drupal\mymodule\Plugin\Menu\TranslatedNodeTab
  deriver: Drupal\mymodule\Plugin\Derivative\TranslatedNodeTabDeriver
  base_route: entity.node.canonical
  route_name: entity.node.edit_form