public function detectLocaleFromLocaleTag($localeIdentifier)
    {
        try {
            return $this->detectLocaleFromTemplateLocale(new Locale($localeIdentifier));
        } catch (Exception\InvalidLocaleIdentifierException $exception) {
            return $this->localizationService->getConfiguration()->getDefaultLocale();
        }
    }
public function detectLocaleFromLocaleTag($localeIdentifier)
    {
        try {
            return $this->detectLocaleFromTemplateLocale(new Locale($localeIdentifier));
        } catch (Exception\InvalidLocaleIdentifierException $exception) {
            return $this->localizationService->getConfiguration()->getDefaultLocale();
        }
    }
public function detectLocaleFromLocaleTag ( $ localeIdentifier ) { try { return $ this -> detectLocaleFromTemplateLocale ( new Locale ( $ localeIdentifier ) ) ; } catch ( Exception \ InvalidLocaleIdentifierException $ exception ) { return $ this -> localizationService -> getConfiguration ( ) -> getDefaultLocale ( ) ; } }
Returns best-matching Locale object based on the locale identifier
provided as parameter. System default locale will be returned if no
successful matches were done.

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