protected function ContentAwareGenerator::getLocale

Determine the locale to be used with this request

Parameters

array $parameters the parameters determined by the route:

Return value

string|null the locale following of the parameters or any other information the router has available.

3 calls to ContentAwareGenerator::getLocale()
ContentAwareGenerator::getBestLocaleRoute in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php
Determine if there is a route with matching locale associated with the given route via associated content.
ContentAwareGenerator::getRouteByContent in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php
Get the route based on the $name that is a RouteAwareInterface or a RouteAwareInterface content found in the content repository with the content_id specified in parameters.
ContentAwareGenerator::unsetLocaleIfNotNeeded in drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php
Unset the _locale parameter if it is there and not needed

File

drupal/core/vendor/symfony-cmf/routing/Symfony/Cmf/Component/Routing/ContentAwareGenerator.php, line 222

Class

ContentAwareGenerator
A generator that tries to generate routes from object, route names or content objects or names.

Namespace

Symfony\Cmf\Component\Routing

Code

protected function getLocale($parameters) {
  if (isset($parameters['_locale'])) {
    return $parameters['_locale'];
  }
  return null;
}