Mcamara\LaravelLocalization\LaravelLocalization::findTranslatedRouteByPath PHP Method

findTranslatedRouteByPath() protected method

Returns the translated route for the path and the url given
protected findTranslatedRouteByPath ( string $path, string $url_locale ) : string | false
$path string Path to check if it is a translated route
$url_locale string Language to check if the path exists
return string | false Key for translation, false if not exist
    protected function findTranslatedRouteByPath($path, $url_locale)
    {
        // check if this url is a translated url
        foreach ($this->translatedRoutes as $translatedRoute) {
            if ($this->translator->trans($translatedRoute, [], "", $url_locale) == rawurldecode($path)) {
                return $translatedRoute;
            }
        }
        return false;
    }