How do I change the text of the "View" and "Edit" links on the user account page? I'm looking for a way to change the text being displayed in the links on the user account page. 



More specifically, I'm trying to change the text "View" and "Edit" to "View Profile" and "Edit Profile". Ideally, I would prefer a solution that allows me to do this in my .theme file via a preprocessor or a hook function.
As I know you can't do it in your theme, but it is possible to do in your module.

/**
 * Implements hook_menu_local_tasks_alter().
 */
function mymodule_menu_local_tasks_alter(&amp;$data, $route_name) {
  // Change title for user profile's tabs.
  foreach ($data['tabs'] as &amp;$tabs) {
    foreach ($tabs as &amp;$tab) {
      $route_name = $tab['#link']['url']-&gt;getRouteName();
      if ($route_name == 'entity.user.canonical') {
        $tab['#link']['title'] = t('View profile');
      }
      elseif ($route_name == 'entity.user.edit_form') {
        $tab['#link']['title'] = t('Edit profile');
      }
    }
  }
}