$language_name = '<strong>' .
$this->
t('@language (original)',
['@language' =>
$language->
getName()]) . '</strong>';
// Check access for the path/route for editing, so we can decide to
// include a link to edit or not.
$edit_access =
$this->accessManager->
checkNamedRoute($mapper->
getBaseRouteName(),
$route_match->
getRawParameters()->
all(),
$this->account
);
// Build list of operations.
$operations =
[];
if ($edit_access) { $operations['edit'
] =
[ 'title' =>
$this->
t('Edit'
),
'url' => Url::
fromRoute($mapper->
getBaseRouteName(),
$mapper->
getBaseRouteParameters(),
['query' =>
['destination' =>
$mapper->
getOverviewPath()]]),
];
} } else { $language_name =
$language->
getName();
$operations =
[];
// If no translation exists for this language, link to add one.
if (!
$mapper->
hasTranslation($language)) { $operations['add'
] =
[ 'title' =>
$this->
t('Add'
),