Implements \Drupal\Core\Path\AliasManagerInterface::getPathAlias().
Overrides AliasManagerInterface::getPathAlias
public function getPathAlias($path, $path_language = NULL) {
// If no language is explicitly specified we default to the current URL
// language. If we used a language different from the one conveyed by the
// requested URL, we might end up being unable to check if there is a path
// alias matching the URL path.
$path_language = $path_language ?: $this->langcode;
$result = $path;
if (!empty($path) && ($alias = $this
->lookupPathAlias($path, $path_language))) {
$result = $alias;
}
return $result;
}