SymfonyRoute $route:
string $locale:
bool TRUE if there is either no $locale, no _locale requirement on the route or if the requirement and the passed $locale match.
private function checkLocaleRequirement(SymfonyRoute $route, $locale) {
return empty($locale) || !$route
->getRequirement('_locale') || preg_match('/' . $route
->getRequirement('_locale') . '/', $locale);
}