How do I change the name of the "view" node tab for a specific content type? I am using Drupal 8. I have a content type "hotel". I would like to change the default tab name "View" only for this content type "hotel". I can change the default tab name "View" by mymodule.links.task.yml (please see below code), but it applies to all content types.

entity.node.canonical:
  route_name: entity.node.canonical
  base_route: entity.node.canonical
  title: 'Summary'


So how do I change the default tab name "View" ONLY for a content type?
In your theme open file THEMENAME.theme, and the add code below:
function MYTHEME_preprocess_menu_local_task(&amp;$variables) {
  if (isset($variables['element']['#link']['title']) &amp;&amp; $variables['element']['#link']['title'] == 'View') {
    $node = \Drupal::request()-&gt;attributes-&gt;get('node');
    if ($node &amp;&amp; $node-&gt;getType() == 'hotel') {
      $variables['link']['#title'] = t('Hotel View');
    }
  }
}

Clear all cache and see result.