'#type' => 'table',
'#header' =>
[$this->
t('Language'
),
$this->
t('Operations'
)],
];
foreach ($languages as $language) { $langcode =
$language->
getId();
// This is needed because
// ConfigMapperInterface::getAddRouteParameters(), for example,
// needs to return the correct language code for each table row.
$fake_route_match = RouteMatch::
createFromRequest($fake_request);
$mapper->
populateFromRouteMatch($fake_route_match);
$mapper->
setLangcode($langcode);
// Prepare the language name and the operations depending on whether this
// is the original language or not.
if ($langcode ==
$original_langcode) { $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.