Detector
class Detector (View source)
The Detector class provides methods for automatic locale detection
Properties
protected Service | $localizationService | ||
protected LocaleCollection | $localeCollection | A collection of Locale objects representing currently installed locales, in a hierarchical manner. |
Methods
Returns best-matching Locale object based on the Accept-Language header provided as parameter. System default locale will be returned if no successful matches were done.
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.
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.
Details
void
injectLocalizationService(Service $localizationService)
No description
void
injectLocaleCollection(LocaleCollection $localeCollection)
No description
Locale
detectLocaleFromHttpHeader(string $acceptLanguageHeader)
Returns best-matching Locale object based on the Accept-Language header provided as parameter. System default locale will be returned if no successful matches were done.
Locale
detectLocaleFromLocaleTag(string $localeIdentifier)
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.