public function detectLocaleFromTemplateLocale(Locale $locale)
    {
        $bestMatchingLocale = $this->localeCollection->findBestMatchingLocale($locale);

        if ($bestMatchingLocale !== null) {
            return $bestMatchingLocale;
        }

        return $this->localizationService->getConfiguration()->getDefaultLocale();
    }
public function detectLocaleFromTemplateLocale(Locale $locale)
    {
        $bestMatchingLocale = $this->localeCollection->findBestMatchingLocale($locale);

        if ($bestMatchingLocale !== null) {
            return $bestMatchingLocale;
        }

        return $this->localizationService->getConfiguration()->getDefaultLocale();
    }
public function detectLocaleFromTemplateLocale ( Locale $ locale ) { $ bestMatchingLocale = $ this -> localeCollection -> findBestMatchingLocale ( $ locale ) ; if ( $ bestMatchingLocale !== null ) { return $ bestMatchingLocale ; } return $ this -> localizationService -> getConfiguration ( ) -> getDefaultLocale ( ) ; }
Returns best-matching Locale object based on the template Locale object
provided as parameter. System default locale will be returned if no
successful matches were done.

@param Locale $locale The template Locale object
@return Locale Best-matching existing Locale instance
@api
Returns best - matching Locale object based on the template Locale object provided as parameter . System default locale will be returned if no successful matches were done .