public function getUrlFromRouteName($locale, $defaultLocale, $transKey, $attributes = [], $defaultHidden = false)
{
if (!is_string($locale)) {
$locale = $defaultLocale;
}
$route = '';
if (!($locale === $defaultLocale && $defaultHidden)) {
$route = '/' . $locale;
}
if ($this->hasTranslation($transKey, $locale)) {
$translation = $this->trans($transKey, $locale);
$route = Url::substituteAttributes($attributes, $route . '/' . $translation);
}
return $route;
}