Translates a route name to its router item path.
string $route_name: The route name to translate.
string The translated path pattern from the route.
function _menu_router_translate_route($route_name) {
$route = Drupal::service('router.route_provider')
->getRouteByName($route_name);
$path = trim($route
->getPattern(), '/');
// Translate placeholders, e.g. {foo} -> %.
return preg_replace('/{' . DRUPAL_PHP_FUNCTION_PATTERN . '}/', '%', $path);
}