protected findTranslatedRouteByUrl ( string | false | null $url, array $attributes, string $locale ) : string | false | ||
$url | string | false | null | Url to check if it is a translated route |
$attributes | array | Attributes to check if the url exists in the translated routes array |
$locale | string | Language to check if the url exists |
리턴 | string | false | Key for translation, false if not exist |
protected function findTranslatedRouteByUrl($url, $attributes, $locale)
{
if (empty($url)) {
return false;
}
// check if this url is a translated url
foreach ($this->translatedRoutes as $translatedRoute) {
$routeName = $this->getURLFromRouteNameTranslated($locale, $translatedRoute, $attributes);
if ($this->getNonLocalizedURL($routeName) == $this->getNonLocalizedURL($url)) {
return $translatedRoute;
}
}
return false;
}